Control Flow & Loops
Decisions and repetition · 8 lessons
Teach your code to choose with if / elif / else and boolean logic, then repeat work with for and while loops, range(), break, continue and nesting.
Practice this track with instant, on-device checks in CodeCub.
Get the appLessons in this track
- 1if / else
- 2and / or / not
- 3elif chains
- 4for loops
- 5range()
- 6while loops
- 7break & continue
- 8Nested loops
How you'll be checked
Each lesson pairs a short explanation with 2–3 exercises, graded deterministically on your device:
🔮 Predict the output
Read a snippet and say exactly what it prints — the fastest way to build a mental model of how Python runs.
✏️ Fill the blank
Complete the missing token so the code does what the prompt asks. No syntax hand-holding.
🔢 Order the lines
Drag shuffled lines back into the sequence that produces the right result.
✅ Pick the answer
Choose the correct statement about behaviour, output or a concept.