0Pricing
Coding for Kids · Lesson

Looking Things Up

Find values by key.

Looking Things Up is a free Coding for Kids lesson on CoddyKit — lesson 2 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, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Looking Things Up 🔍

A dictionary lets you look up a value by its key, super fast! Like finding a word in a real dictionary. 📖

Use the Key 🔑

Put the key in square brackets to grab its value.

hero = {"name": "Zara", "power": "fly"}
print(hero["power"])

Look Up a Number 🔢

Looking up works for number values too.

game = {"score": 42, "lives": 3}
print(game["score"])

Save What You Find 💾

You can save the looked-up value in a new variable!

hero = {"name": "Zara"}
who = hero["name"]
print("Hello " + who)

Look Up Twice 🔁

You can look up many keys, one after another.

fruit = {"apple": 3, "banana": 5}
print(fruit["apple"])
print(fruit["banana"])

Missing Key Oops 😅

If the key is not there, Python gets confused! Use .get() to stay safe.

box = {"toy": "car"}
print(box.get("candy"))

Safe Look Up 🛡️

.get() gives None for a missing key instead of an error.

box = {"toy": "car"}
print(box.get("toy"))

Backup Answer 🎁

You can give .get() a backup value for when the key is missing!

box = {"toy": "car"}
print(box.get("candy", "none"))

Check If Inside ✔️

Use in to check if a key exists. It gives True or False!

box = {"toy": "car"}
print("toy" in box)

Look Up Then Use 🧮

Use a looked-up number right away in math!

game = {"coins": 10}
print(game["coins"] + 5)

Lookups Are Speedy ⚡

Dictionaries find values instantly by key. No counting through every item like a list! 🚀

Quick Check ✅

Which one is safe when a key might be missing? 🤔

Super Sleuth! 🕵️

You can look things up with box["key"] or the safe box.get("key"), and check with "key" in box. Detective level: expert! 🌟

Frequently asked questions

Is the “Looking Things Up” lesson free?

Yes — the full text of “Looking Things Up” is free to read here on the web, and the Coding for Kids course includes 4 lessons in total. 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.

What will I learn in “Looking Things Up”?

Find values by key. 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; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Looking Things Up” 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