CurriculumTalking to the Dragon Tamer

Python input() and Type Conversion for Kids

input() is the one command that genuinely pauses a program and waits for the player to type something back.

15 exercises5 lessonsAges 10+PRO
See what PRO unlocks →

What this topic covers

Every topic before this one runs the instant a child presses Run. input() is different, and that difference is worth teaching deliberately: research on children's programming misconceptions finds that many already expect programs to ask and wait, whether or not the code actually says so. Introducing input() too early risks confirming that wrong expectation instead of correcting it — so this topic arrives after conditionals and loops already exist as a visible contrast.

The topic's real teaching moment is what input() always returns: text, even when a player types digits. A child who tries to add ten to an unconverted answer meets a real Python TypeError, and fixing it with int() is taught at the exact point it matters, rather than as an abstract rule stated before it has ever caused a problem.

It closes by asking three real questions in sequence, some needing conversion and one not — a genuine numbers-versus-text discrimination task, not just three uses of the same new command.

Python from this topic

age = int(input("How old are you? "))
print(age + 1)

Output

11

Python covered here

  • Asking a question with input()
  • input() always returns text, never a number
  • Converting text to a number with int()
  • The TypeError from forgetting to convert
  • Comparing a converted number correctly

The mistake this topic is built to fix

Common mistakeA child assumes input() returns a real number whenever the player types digits.

It never does — input() always returns text. Adding or comparing that text as if it were a number either glues values together unexpectedly or raises a genuine TypeError, and this topic uses that real crash, not a description of it, to teach the fix.

The lessons, in order

  1. input() asks, and really waitsThe one command that genuinely talks to the player — everything before this never did.3 exercises
  2. int() turns text into a numberinput() always gives you text — int() is how you turn digits into a real, usable number.3 exercises
  3. What happens if you forget int()Text plus a number is a real Python crash — and the error tells you exactly what went wrong.3 exercises
  4. The Dragon's Three Questionsinput(), int(), and choosing which answers actually need converting — all at once.3 exercises
  5. Validating inputRe-ask until the answer is actually valid — using a while loop wrapped around input().3 exercises

Lessons unlock in order within a topic, so nothing arrives before the idea it depends on. This topic is part of PRO — $6.99 unlocks it along with everything else.

Try it now

The very first level needs no account at all — see whether it clicks before signing up for anything.

Play the first level free →