The IF statement is used in programming to make selections, or decisions.
IF statements consist of:
An example of what an IF statement could do is, IF the test score is over 50 then display a message saying “Well done”, otherwise display a message saying “You did not pass”.
In Python this would look like:
if test_score >= 50: print("Well done") else: print("You did not pass")
In Python, the conditions can use logical operators to compare values: