Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial →
← CoursesPython FoundationsModule 2 · Data structuresContacts dictionarywrite17 / 174
+75 XP
Task
📝 **Task:** Build a phone book using a dictionary. 📋 **Steps:** 1. Create the dict `contacts = {"Anna": "050-111-22-33"}` 2. Add a new contact: `contacts["Boris"] = "067-444-55-66"` 3. Print Boris's number via `print(contacts["Boris"])` 💡 **Similar example (prices):** ```python prices = {"apple": 25} prices["bread"] = 18 print(prices["bread"]) # 18 ``` ⚠️ **Hint:** access a value with square brackets and the key: `contacts["Anna"]`. 🎯 **Expected output:** `067-444-55-66`
✏️ Write your code here
🐍
Loading Python...
One-time download (~1 MB). Then it runs instantly.
📊 Result
Press Run to see result...

💬 Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…