📘 Lesson 7: Dictionaries & Advanced Structures

Dictionaries in Python allow you to store data using key-value pairs. They're very useful for organizing data that has labels.

📌 What You'll Learn

🔤 Example

student = {
  "name": "Ali",
  "age": 16,
  "grades": [85, 90, 92]
}

print(student["name"])        # Ali
student["age"] = 17           # Update value
student["city"] = "Istanbul"  # Add new key-value pair

for key in student:
    print(key, ":", student[key])

📝 Your Turn: Assignment

Create a dictionary-based contact book! Here's what it should do:

Advanced idea: Use a loop and let the user type "done" when they want to stop.

← Back to Dashboard