And variable naming specification 1-6

1. The variable naming convention:

# ① must be letters, numbers or underlines. 

#例如:_name_ ="alex"     print("_name_") =alex    √

# ② can not be a pure digital can not begin with a digit.

# ③ Do not use Chinese. Many countries excluding Chinese computer language.

# ④ can not use keywords. Python keyword is already occupied by something.

# ⑤ not too long. Variable names readability is poor, but you can use is not recommended.

# ⑥ to be meaningful. Recommended variables English, case sensitive.

# For example: game = "King of Glory"

 

2. Recommended use variable names:

# ① hump (word capitalized) For example: LiAiYang

# ② underscore example: li_ai_yang

 

Guess you like

Origin www.cnblogs.com/alu-/p/11347578.html