Python Dictionaries for Kids

A dictionary is a stat sheet — a value looked up by its name, not by its position in a list.

  • 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

Children arrive at this topic already fluent with lists, which look things up by position. A dictionary asks a genuinely different question — not 'what's in slot zero' but 'what's stored under this name' — and the topic draws that contrast explicitly from its first example, rather than letting the two lookup styles blur together.

Updating a dictionary follows the same 'read the old value to make the new one' pattern already taught for variables, one level of indirection deeper, and adding a brand new key is shown to require no special command at all — just naming it.

The last new idea is a real crash: asking for a key that was never set raises a KeyError, and .get() with a default is the fix, taught by first showing the actual error rather than describing it in the abstract. The topic closes with a list of dictionaries — a whole party roster — combining every topic taught so far.

Built around a real misconception

The mistake this topic is built to fix

Common mistake

A child tries to look up a dictionary value by position, the way they would with a list.

Why the topic is built around it

A list and a dictionary answer different questions — 'what's here' versus 'what's named this' — and conflating them produces code that looks plausible but asks the wrong question. The topic makes the contrast explicit rather than assuming it's obvious.

dictionaries.pyPython 3
dragon = {"name": "Ember", "hp": 40}print(dragon["hp"])
Output40

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. Named values, looked up by NAME instead of position — the key difference from a list.

    • Explain
    • Ask
    • Guided 1 level
    • Practice 2 levels
  2. Read the old value to make the new one — and setting a NEW key creates it on the spot.

    • Explain
    • Ask
    • Guided 1 level
    • Practice 2 levels
  3. dragon["mana"] crashes if mana was never set. dragon.get("mana", 0) doesn't.

    • Explain
    • Ask
    • Guided 1 level
    • Practice 2 levels
  4. Dicts, lists, loops, and decisions — a whole party, checked one dragon at a time.

    • Explain
    • Ask
    • Guided 1 level
    • Challenge 2 levels
  5. A dict can count things for you — one running total per key, all through one loop.

    • 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