This lesson introduces Python commands that control how the computer executes a program. These commands include conditional statements, which control, based on a pre-defined condition, what code blocks are executed, and looping statements, which repeat code blocks until a predefined condition is met.
By the end of this lesson, you will be learn about
if
statements to perform conditional code evaluation,for
statements to iteratively process data, andwhile
statements to perform a predefined operation until a condition is reached.Approximately 2 hours.
Video: Watch the Python flow control video, which will discuss how to use flow control statements like conditional statements and loops to write more effective and powerful Python program.
Notebook: Read and complete the practice exercises in the Python flow control notebook.
© 2017: Robert J. Brunner at the University of Illinois.
This notebook is released under the Creative Commons license CC BY-NC-SA 4.0. Any reproduction, adaptation, distribution, dissemination or making available of this notebook for commercial use is not allowed unless authorized in writing by the copyright holder.