A Mini Phone Book
Build a name-to-number book.
A Mini Phone Book is a free Coding for Kids lesson on CoddyKit — lesson 4 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.
A Mini Phone Book 📞
Let us build a real thing: a phone book! Names are keys, numbers are values. 📖
Make the Book 📒
Start with a few friends and their numbers.
book = {"Mom": "555-1234", "Leo": "555-7777"}
print(book)Find a Number 🔎
Look up a friend by name to get their number!
book = {"Mom": "555-1234"}
print(book["Mom"])Add a Friend ➕
New friend? Add them to the book!
book = {"Mom": "555-1234"}
book["Zoe"] = "555-9999"
print(book)Change a Number 🔄
If a number changes, just update it.
book = {"Leo": "555-0000"}
book["Leo"] = "555-7777"
print(book["Leo"])Is It In There? ✔️
Check if a name is in the book with in.
book = {"Mom": "555-1234"}
print("Mom" in book)Safe Search 🛡️
Use .get() so a missing name does not crash.
book = {"Mom": "555-1234"}
print(book.get("Dad", "not found"))Remove a Contact 🗑️
Delete someone who moved away.
book = {"Mom": "555-1234", "Leo": "555-7777"}
del book["Leo"]
print(book)Count Contacts 🔢
How many friends are in the book?
book = {"Mom": "1", "Leo": "2", "Zoe": "3"}
print(len(book))Show All Names 📜
Loop through to print every friend and number!
book = {"Mom": "1234", "Leo": "7777"}
for name in book:
print(name, book[name])Your Own Book 🌟
A phone book is just a dictionary with names as keys! You can build a sticker collection, a pet list, or a high-score table the same way. 🏆
Quick Check ✅
One more brain snack! 🍪
Phone Book Pro! 📱
You built a working phone book! Add, find, change, and remove contacts using keys. Dictionaries make great mini apps! 🎉
Frequently asked questions
Is the “A Mini Phone Book” lesson free?
Yes — the full text of “A Mini Phone Book” 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 “A Mini Phone Book”?
Build a name-to-number book. 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 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “A Mini Phone Book” 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
- What Is a Dictionary?
- Looking Things Up
- Adding and Changing
- A Mini Phone Book