Create and execute Python files
create
- Create the command line: eg, open / .py a new file (input terminal the gedit.
gedit tset.py
); - Created directly in the editor;
carried out
- Input terminal
python3 test.py
Process Control
Conditional
- if
- elif
- else
- Note colon end of the line
- Note 4 indent the next line
cycle
- the for loop (previously known cycles);
for item in iterable:
- range () function: 1) range (x) can generate a sequence of integers from 0 to x-1's; 2) range (a, b) no header trailer, to generate a sequence of integers from a to b-1;
- while loop (the number of previously unknown)
- break (stop cycle)
- continue (skip this wheel cycle)