Speaking of Process Control, in fact, if you learn other languages, then learn these will feel very simple, because the principle is the same, but the syntax has changed. So as a programmer must be in-depth understanding of a language, learning a lot of language, but not proficient in some of the words, is equal to not learning, can only say that you know a little more.
Basic process structure of the program:
Sequential structure
Select structure
Loop structure
The order structure is the simplest program flow, the program according to the statement, the execution of a sentence, do not encounter logical judgment or loop situation
Select structure:
The simplest choice structure:
If True: #statements1else: #statements2
Multi-Branch selection structure:
If Condition1: #statements1elif condition2: #statements2 ... else: #statements
In Python, where there are no switch and case statements, multiple branches are equivalent to substitution.
For loop, the loop object must be one that is an iterable (enumerable) object.
As an example:
This allows you to iterate through all the values in the list, looping through lists, tuples, collections, and dictionaries.
Range () function
Range () is a built-in function in Python that allows you to generate arithmetical progression sequences.
>>> list (range (1,10)) [1, 2, 3, 4, 5, 6, 7, 8, 9]
You can also set Delta δ.
>>> list (range (1,10,2)) [1, 3, 5, 7, 9]
Python Process Control