Skip to content

Chapter 9: Dictionaries

Dictionaries store data in key-value pairs.

Example

Python
1
2
3
4
5
person = {
    "name": "Alice",
    "age": 30,
    "city": "New York"
}

You can access values by using their keys, like person["name"].