Coding: conditions

Sign up free to unlock this topic

Kindergarten is free, and guests can try one sample topic in every other grade. A free parent or teacher account opens every topic from Kindergarten to Grade 12 and saves progress. No credit card.

Try the free sample: Numbers to 1,000,000 · Have a class or homeroom code? Join here

Key idea: Coding: conditions

A condition in code (if … then … else) runs one set of steps when something is true and another when it's false.

Key words

Condition
A test, like points > 20.
Else
What happens when the test is false.

🔎 What to look for: Check the condition with the current value, follow only the branch that applies, then keep going line by line.

Zero2Hero — Zéro2Héros