Rules to respect while naming variables
Info:
Variables are one of the most important elements while coding. In Python there are certain rules that you should respect while naming them.
The following are the variable rules that you should keep in mind:
- Variable names can contain only letters, numbers and underscore. They can start with a letter or underscore but NOT with a number.
- Variable names can NOT contain spaces. To separate words in variables, you use underscores. For example:
sorted_list
. - Variable names can NOT be the same as keywords, reserved words, and built-in functions in Python.