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 exercises
  • 5 lessons
  • Ages 10+
  • PRO

This topic is part of PRO — a one-time $49.99 purchase, no subscription. Topics 1–3 are free, start to finish, and the first level needs no account.

For parents & teachers

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.

Built around a real misconception

The mistake this topic is built to fix

Common mistake

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

Why the topic is built around it

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.

input.pyPython 3
age = int(input("How old are you? "))print(age + 1)
Output11

Explain · Ask · Guided · Practice

The lessons, in order

Each lesson explains one idea in short steps, checks it landed with a question, walks through a guided first try, then leaves the child to practise on their own.

  1. The one command that genuinely talks to the player — everything before this never did.

    • Explain
    • Ask
    • Guided 1 level
    • Practice 2 levels
  2. input() always gives you text — int() is how you turn digits into a real, usable number.

    • Explain
    • Ask
    • Guided 1 level
    • Practice 2 levels
  3. Text plus a number is a real Python crash — and the error tells you exactly what went wrong.

    • Explain
    • Ask
    • Guided 1 level
    • Practice 2 levels
  4. input(), int(), and choosing which answers actually need converting — all at once.

    • Explain
    • Ask
    • Guided 1 level
    • Challenge 2 levels
  5. Re-ask until the answer is actually valid — using a while loop wrapped around input().

    • Explain
    • Ask
    • Guided 1 level
    • Practice 2 levels

Lessons unlock in order within a topic, so nothing arrives before the idea it depends on. This topic is part of PRO — $49.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