Lesson 3 of 7 · 6 min

Conditionals and loops in code

Real programs combine conditionals (if/else decisions) with loops (repeat while or for a count). A loop can repeat until a condition is met: 'keep asking for a password while it's wrong'. Together they make programs flexible and powerful.

if…   while…

Decisions and repetition working together

Let’s try it! ✍️

Question 1 of

🎉

Great job!

You finished this lesson.

Next lesson → All lessons