If Statements

If statements add decision making logic to your code. The if statement is used to match a defined condition to a True or False boolean outcome. So with an if statement we can start to introduce different paths through our code and provide different outcomes depending on our inputs.

In this chapter we look at how we can define if, elif and else statements in our code.