Skip to content

Lesson 4 of 4 · 7 min

Make decisions with if

Programs can make choices. An if statement checks a condition. If it is true, the indented code runs.

else gives the computer something to do when the condition is false.

Your turn: Decide which message appears.

score = 72
if score >= 50:
    print("You passed!")
else:
    print("Try again")

Quick check

What is printed when score = 72?