Coding for Kids · Lesson

What Is a Dictionary?

Store labeled pairs.

Lesson 1 of 413 steps

What Is a Dictionary? is a free Coding for Kids lesson on CoddyKit. This is lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Coding for Kids learning path, and your progress syncs across the web and the CoddyKit app. The Coding for Kids course includes 4 lessons in total.

Word Boxes! 📦

A dictionary is like a box of labeled drawers! 🗄️ Each drawer has a label (the key) and something inside (the value).

Curly Braces 🌀

We build a dictionary with curly braces { }. Inside we put key: value pairs!

pet = {"name": "Rex"}
print(pet)

Key and Value 🔑

The key is the label. The value is what is stored. Here the key is "name" and the value is "Rex"! 🐶

pet = {"name": "Rex"}
print(pet["name"])

Many Drawers 🗃️

One dictionary can hold lots of pairs. Just separate them with a comma!

cat = {"name": "Mimi", "age": 3, "color": "gray"}
print(cat)

Read One Drawer 👀

To peek inside a drawer, use square brackets with the key name.

cat = {"name": "Mimi", "age": 3}
print(cat["age"])

Numbers as Values 🔢

Values can be numbers too, not just words!

score = {"level": 5, "coins": 100}
print(score["coins"])

A Friend Card 🪪

Imagine a tiny info card about a friend. A dictionary is perfect for that!

friend = {"name": "Lila", "hobby": "drawing"}
print(friend["hobby"])

Mixed Stuff 🎒

A dictionary can mix words and numbers as values. So flexible!

me = {"name": "Sam", "age": 9}
print("I am " + me["name"])

Print It All 🖨️

Print the whole dictionary to see every drawer at once.

toy = {"type": "robot", "battery": 80}
print(toy)

Empty Box 📭

You can start with an empty box and fill it later: box = {}.

box = {}
print(box)

Why Dictionaries? 💡

Lists use number spots (0, 1, 2). Dictionaries use name labels instead, so it is easy to remember what is inside! 🎉

Quick Check ✅

Time for a brain snack! 🍪

You Did It! 🌟

You learned that a dictionary stores key: value pairs in labeled drawers. Use { } to make one and box["key"] to peek inside! 📦

Free to start

Learn Python with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
35
Lessons
140

Frequently Asked Questions

Is the “What Is a Dictionary?” lesson free?

Yes — the full text of “What Is a Dictionary?” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Coding for Kids course, upgrade to CoddyKit PRO. The Coding for Kids course includes 4 lessons in total.

What will I learn in “What Is a Dictionary?”?

Store labeled pairs. You practise Coding for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Coding for Kids?

No prior experience is required. Coding for Kids on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.

How long does the “What Is a Dictionary?” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Coding for Kids lesson?

Yes. Every Coding for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. What Is a Dictionary?
  2. Looking Things Up
  3. Adding and Changing
  4. A Mini Phone Book
← Back to Coding for Kids