Python Essay: naming variables and constants

Variable to store some intermediate results of the program during the operation, in order to facilitate future calls.

      

Variable naming rules:

1, be descriptive

2, the variable name only _, numbers, letters, spaces or special characters are not (#? <., $ *! ~)

3, Chinese can not be a variable name (not recommended, rules)

4, can not start with a number

5, reserved characters can not be used

 

Constants : a constant amount, such as pi pie = 3.141592653 ...

In python which all variables are variable, so use all uppercase variable names to represent this variable is constant.

 

Guess you like

Origin www.cnblogs.com/lizhen416/p/11403830.html