Pack 2 / Logic
if
Lesson pack2-1
if
not started
Hook
if lets your program make its first decision.
Write if followed by a condition and a colon.
Indented code runs only when the condition is true.
This is how games choose what happens next.
Mini Challenge
Create stars = 5. If stars is greater than 3, print "Door open".
Full lesson mode with normal detail.
Code Lab
Try it now
Output updates below
Output
Shop unlocked!
Run the code, tweak it, then beat the challenge.
