In Python The 'if' statement is used to conditionally execute a statement. In other words we look at a statement(conditional) and decide if that conditional statement is true or false,we then do one thing when the condition is true and something else when the condition is false.
A conditional statement is any statement that can be determined to be True or False. To make a statement conditional we use comparison operators
Look at the conditional statement in the diamond below, should we DO THIS or DO THAT?
What about this next one, should we DO THIS or DO THAT?
Extension Task
Can you change the condition so that it doesn't print anything out at all?
Extension Task
Can you change the condition to check if the two numbers are the same and print out suitable statements?
Sometimes we want to have more that two otions when we make a choice we can do that in python by using an elif statement.
Extension Task
1. Can you change the code so that the user inputs a number and you then print out whether it is small medium big or huge?
2. Can you develop the code so that the user can input their favourite colour and you then print out something about the colour they chose?