6 If Statements

6 If Statements#

Control flow dictates the order in which your lines of code are executed. To make complex programs, we need often need more than a list of statements to be executed sequentially. If statements can be used to branch the control flow based on evaluating given conditions. 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. Before continuing with this chapter, read the short chapter 2 Control Flow Diagrams if you haven’t already.