Control Flow: If Statements#

Control flow dictates the order in which your lines of code are executed. In order to make complex programs, we need to make more than a list of statements to be executed sequentially. Control flow gives us tools to execute blocks of code conditionally (with if statements) and repeatedly (with loops).

In this chapter we shall cover if statements, but first we need to discuss Boolean data types and the logical operators which act on them.