CurriculumPython for Loops and range() for KidsThe Dragon Patrol

Practice Challenge: Loops, Counting, and Decisions Together

Loops, counting, and decisions — all working together, pass after pass.

Lesson 4 of 5PROAges 10+
See what PRO unlocks →

The Dragon Patrol

One more trick before the challenge: you can loop over a LIST directly, not just numbers from range().

for strength in strengths: visits each value in the list, one at a time — no range() or index needed.

strengths = [30, 60, 90]
for strength in strengths:
    print(strength)

Output

30
60
90

And you can put an if/elif/else INSIDE a loop — the same decision, made fresh on every single pass.

Check your understanding

strengths = [30, 60, 90]. Using if/elif/else with 80 and 40 as cutoffs, how many lines print in total?

  • 3 — one reaction per dragon
  • 9 — every dragon checked against every rule
  • 1 — only the last dragon's strength matters

Why: Three dragons, one loop pass each, one if/elif/else decision each — three lines total. The loop and the conditional work together: the loop provides how many times, the conditional provides which reaction each time.

What you'll practice

Print each chest number (0 to 4) AND keep a running total of 100 gold added per chest, printing the total after each one.

Unlock this lesson with PRO →

More from this topic

The Dragon Patrol is one lesson inside Python for Loops and range() for Kids — see the full lesson order and what the whole topic covers.

View the full topic →