Figure 4.3. The flow of program execution with combined conditional statements.
One of the blocks of code ‘a’, ‘b’ or ‘c’ will be executed depending on the truth or
falsehood of statements that follow the ‘if’ and ‘elif’ keywords. If the conditional
expression at the ‘if’ evaluates as true then code block ‘a’ is executed, otherwise if the
conditional expression at ‘elif’ evaluates as true then instead code block ‘b’ is executed,.
Finally, if none of the conditional expressions evaluates as true then code block ‘c’ is
executed (so there is no additional conditional expression to evaluate for this, the block is
just executed).
Do'stlaringiz bilan baham: |