Practice Challenge: Judging Every Case with if/elif/else

Judge every dragon fairly — one title each, even the tricky ones.

  • Lesson 4 of 5
  • PRO
  • Ages 10+
  • 3 hands-on levels
See what PRO unlocksA one-time $49.99 purchase. Topics 1–3 are free.

The dragon explains

The Dragon Council

  1. The dragon: You know comparisons, if, elif, and else. The council challenge just needs all four together.

  2. The dragon: Remember: elif stops at the FIRST match, even when a later condition would also be true.

    example.pyPython 3
    strength = 85if strength >= 80:    print("Mighty")elif strength >= 40:    print("Strong")
    OutputMighty
  3. The dragon: One dragon, one title. That rule matters even more now — you'll judge three dragons at once.

Quick check

Check your understanding

Say your answer out loud before reading the marked one. Every wrong option is a mistake real beginners make.

  1. Question 1 of 1

    strength = 85, using if/elif/else with 80 and 40 as the cutoffs. How many titles print?

    • One — MightyCorrect
    • Two — Mighty and Strong
    • Zero — 85 doesn't match any range exactly

    Why: 85 >= 80 is True, so Mighty prints and the chain stops right there — elif never even checks the 40 condition. One dragon, one title, always.

In the game

What you'll practice

Three levels in the game: one guided first try with the shape of the answer already there, then two to solve on your own.

  1. 1

    GuidedYour first try

    Gold is 200. If gold is 100 or more, say 'The door opens.' Otherwise, say 'Locked.' Use a variable, a comparison, and if/else together.

  2. +2

    PracticeTwo more, on your own

This lesson is part of PRO.

PRO is a one-time $49.99 purchase, no subscription, and unlocks this whole topic along with everything else. Topics 1–3 are free, start to finish.

Unlock this lesson with PRO

Stuck three times? The game offers the answer — unasked.