April 2021
Beginner
296 pages
7h 10m
English
The programs you have written so far execute line by line, beginning at the top of the code and ending at the bottom. You can visualize this flow as a series of steps that execute in a linear fashion, which means that the program can run in only one way. In this chapter, you’ll explore how to write divergent paths for Python to follow, depending on whether certain conditions are met. This is useful because you can execute different actions in your program depending on the scenario—think of the way a video game directs you to different levels or screens contingent on your performance.
To evaluate a condition, you’ll ...
Read now
Unlock full access