The composition of the Python program
1. The Python program is composed of modules. One, module corresponding to Pythom source file, general suffix Teacher:. py
2. The module is composed of statements. Running the Python program is done in the order of the statements in the module
3, the statement is the Python program's constituent unit, is used to create the object, the variable assignment call function and so on.
Creation of Python files execution
Interactive mode, only one statement can be executed at a time. Writing multiple statements to implement complex logic requires creating a Python file in which to execute the file.
In the idle environment, create a new Python file with File-->new.
Indentation of code
Indentation is a mandatory syntax specification for the Python language. Indents are usually represented by four spaces.
Comments
Previously mentioned, no Duplicate records
Line connector
There is no limit to the length of code per line, but for greater readability, a long line of code is divided into lines, using \ Connection
>>> a = [10,20,30,40,\
50,60,70,\
80,90,100]
>>> A
[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
The composition of the Python program