3 Control Flow in Python

In this week we will focus on the key ways of controlling the flow of programs in Python. We will look at branching and loops, common for all programming languages and the details of their design in Python. Several Python-specific mechanisms of control flow, such as list and dictionary comprehensions will be discussed.


  • Guttag. Chapters 2.3, 2.5-2.6


  • Conditional statements and iterations
  • List and dictionary comprehensions