First, naming rules
1. Variable names, package names, module names are usually lowercase, or you can use underscores
2. The class name is capitalized and the object name is lowercase. Private variable of class, private method prefixed with two underscore
Example: Class Student: #类名
Student = Student ("ddd") #对象
3. Function names are usually lowercase
Example: Def comparenum (NUM1,NUM2)
Two, code indentation and colon
Code indentation means the hierarchical relationship between each line of code by entering spaces and tabs before each line of code. Code indentation and colons are used to differentiate between the levels of code.
Example: If there is an error in code indentation, Tip: indentationerror:expected an indented block
Third, module import
Module Import with Import
Example: Import sys
Iv. code Comments using #
Support for Chinese annotations, usually preceded by #-*-cpdomg:utf-8-*-
V. Separation of statements
1. You can separate the statements with semicolons or by wrapping them directly
2.Python support multiple lines write a statement
Example: sql = "Select Id,name" \
"From dept" \
"WHERE name = ' A '"
Python Coding specification