โ† All labs

Loops and Conditions

Level 2 ยท Learn It

1. Learn It
2. Try It
3. Quiz Me

A loop repeats a set of instructions so you don't have to write them over and over. For example, 'repeat 5 times: jump' makes a character jump five times.

Loops save time and make code shorter. Instead of writing 'move forward' one hundred times, you can say 'repeat 100 times: move forward.'

A condition is a rule that checks if something is true or false, often written as 'if/then.' For example: 'if the light is red, then stop.'

Combining loops and conditions lets programs make decisions and repeat actions, which is how games and apps react to what you do.

Casey, your friendly science guide
Ready? Let's try one together โ€” I'll explain every answer.