Caffeinated Coder
Book an appointment
Lesson 05 · Basics

Conditionals

A program does not have to run every line. An if statement tests a condition, a comparison that gives true or false, and runs its block only when the answer is true. Follow a ten-line script that picks what to wear from the temperature, run three times so the if, the else if and the else each get their turn.

9 min11 steps5 questionsBeginner
Fig 5 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.