In this chapter, we have learned about how programs in Python flow. We also learned how to control and branch the flow of a Python program by using the two main control statements, that is, if and while. We have also looked at some practical applications of the two control statements and have seen how they differ in implementation and syntax.
In this chapter, we have also increased our knowledge of looping structures. We have seen the structure of a for loop and looked at practical examples. We have also looked into the range function and how it comes in handy when you need to quickly iterate over a list.
Apart from that, we have also covered how and when to nest loops and how to break out of loops prematurely under different conditions and with differing results by using the break, continue, and pass statements.
Armed with this knowledge, you can now start incorporating more complex structures into your programs.
In the next chapter, we will look at functions and how to define them...