Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython
by Richard Hightower
Summary
Control flow allows programs to execute nonsequentially using the if, while, and for compound statements. if conditionally executes a statement, while executes a statement while a condition is true, and for iterates through a sequence. All three can contain else clauses that execute when the if condition is false, when it becomes false, or when the items in a list are or become empty, respectively.
As compound statements, if, while, and for contain clauses. Clauses contain suites and control their execution. if contains if, elif, and else clauses; while contains while and else clauses; and for contains for and else clauses. Within the while and for statements, break and continue, as their names imply, break out of a loop and continue ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access