Chapter 4. Control Flow

Terms in This Chapter

  • Argument

  • break and continue statements

  • Built-in (intrinsic) functions

  • Compound statement

  • else/elif clause

  • for loop

  • Function

  • if, for, and while statements

  • Iteration

  • Key/value pair

  • Looping

  • Method

  • Modulus operator

  • Nested dictionary

  • Sequence

  • String format operator

  • Subordinate statement

  • Suite

Control flow instructs Python, on the basis of certain conditions, to execute particular statements and not others. It also allows repeated execution of statements until some conditions are met and permits branching of conditional execution. In this chapter, we'll cover the if, while, and for compound statements, all of which control statement execution in Python.

Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.