Previously in this book, we covered the following topics:
The Python interpreter
Python syntax
Values and data types
In this chapter, we are going to build on the knowledge that we have acquired so far to dive deeper into the beautiful language that is Python. In this chapter, we will explore how Python handles control statements—in simple terms, how Python handles decision making, for instance, resulting to True if 2 + 3 = 5.
In this chapter, we will also dive deeper into program flow control. In particular, we will look at how we can run code repeatedly or in a loop.
Specifically, we will cover the following topics:
Python program flow
Python control statements, that is, if and while
The differences between if and while
The for loop
The range function
Nesting loops
Breaking out of loops