Services Work Learn About Contact
0/10
Lesson 5 of 10

Dictionaries

A dictionary stores data as key-value pairs, just like a real dictionary has words and definitions. Use curly braces {} and access values by their key.

PYTHON
user = {
    "name": "Ali",
    "age": 25,
    "country": "Denmark"
}

print(user["name"])
user["age"] = 26
print(user.keys())
print(user.values())
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed Python!

You finished all 10 lessons and quizzes. You now know the basics of Python.