Python Variable Naming Convention

Here are few things that we have to remember when naming variables and objects in Python.

  • Python is a case sensitive language. ‘x’ and ‘X’ will be treated as different variables.
  • Python variables can have letter, numbers and underscores only
  • The variable names to begin with a letter or underscore only
  • Single line comments are denoted with ” # ‘ and multiple line comments are with triple quotes ”’ ”’

Few examples-

Python_Variable_Naming.PNG

Cheers!

One thought on “Python Variable Naming Convention

  1. Pingback: Learn Python Step by Step | RP's Blog on data science

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s