I. Elements of the control flow
The beginning of a control flow statement is usually a "condition", followed by a block of code called a clause.
Ii. conditions of the control flow
conditions in order to determine how the next step, so as to find the Boolean value of the expression. Almost all control-flow statements use conditions.
third, code blockSome lines of code can be set as a group and placed in a "code block". You can know the beginning and end of a block of code based on the indentation of the line of code. The code block has 3 rules. 1. When the indentation is increased, the code block begins.
2. Code blocks can contain other blocks of code. 3. The indentation is reduced to zero, or the indentation for the outer enclosing block of code is reduced, and the code block ends. ---------------------------------------------Iv. Control of flow statements1.if Statementsthe clause of the IF statement (that is , the block of statements immediately following the IF statement) is executed when the condition of the statement is true . If the condition is False, the clause is skipped. in English, theif statement might read ": If the condition is true, execute the code in the clause. "In Python , theif statement contains the following sections: (1)if keyword; (2) condition (i.e. an expression that evaluates to True or False ); (3) colon; (4) the code block (called an if clause) that is indented at the beginning of the next line .
Python Control Flow