Lesson 2 of 7
if: your program decides
With if, your program makes choices: when the condition is true, the indented lines below it run.
else catches every other case. Comparisons use >, <, >= (greater or equal) and == (equal).
age = 12
if age >= 10:
print("Welcome!")
else:
print("Come back later.")🎯 Your mission
You scored score = 80 points. If score is greater than or equal to 50, create bonus = 10, otherwise bonus = 0. Then print bonus.
PRO lesson
This advanced chapter is part of CodeAge PRO. Unlock it to keep your adventure going.
Discover PRO →