Skip to main content
← CoursesPython FoundationsModule 2 · Data structuresContacts dictionarywrite16 / 170
💬 Discuss🧪 Playground+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`

Keep going

✏️ Write your code here
🐍
Loading Python...
First visit only — ~5-10s. Stays cached afterward.
📊 Result
Press Run to see result...
📣 Help someone learn PythonShare this lesson with a friend — the first 15 are free, no signup.Tweet

💬 Discussion

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