This chapter introduces another fundamental concept of programming: making choices. Choices are made whenever you want your program to behave differently depending on the data it’s working with. For example, you might want to perform different actions depending on whether a solution is acidic or basic, or depending on whether a user types “yes” or “no” in response to a call to the built-in function input.
Let’s introduce statements for making choices in this chapter called control flow statements (because they control the way the computer executes programs). These statements involve a Python type that represents truth and falsehood.