Python Mini Reference 2022: A Quick Guide to the Modern Python Programming Language for Busy Coders by Yoon Harry

Python Mini Reference 2022: A Quick Guide to the Modern Python Programming Language for Busy Coders by Yoon Harry

Author:Yoon, Harry
Language: eng
Format: epub
Publisher: Coding Books Press
Published: 2022-10-12T00:00:00+00:00


Note that, unlike in many C-style languages, Python’s if statement syntax does not require parentheses around the Boolean expressions in the if and elif lines. Parentheses can still be used for expression grouping purposes.

11.2. The while - else Statement

The while statement is used for repeated execution, similar to the for statement. The while statement’s execution depends on an expression. It tests the expression at every start of iteration and, as long as an expression evaluates to True, it executes the first suite. If the expression turns False (which may be the first time it is tested), then the suite of the else clause, if present, is executed and the loop terminates.

For both while and for statements,

A break statement in the while/for suite terminates the loop without executing the else clause’s suite.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.