Naming rules for variables
1, to have a descriptive
2, variable name can only _, number, letter composition, can not be a space or special characters ([email protected]#$%^&*~)
3. Cannot use Chinese as variable name
4. Cannot start with a number
5. Variable names are case-sensitive
6. Reserved characters cannot be used to name
The following keywords (reserved characters) cannot be declared as variable names
[' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' def ',
' del ', ' elif ', ' Else ', ' except ', ' exec ', ' finally ', ' for ', ' from ',
' Global ', ' if ', ' import ', ' in ', ' was ', ' lambda ', ' not ', ' or ', ' pass ',
' Print ', ' raise ', ' return ', ' try ', ' while ', ' with ', ' yield '
Cases:
Student_number=30 #Python官方建议命名规则
Studnetnumber=30 #驼峰体
Constant
There are no constants in Python, and all the quantities are variable,
In order to differentiate constants and variables, constants are represented as constants with all uppercase variable names.
Python Variable naming conventions