Loading…
Dictionaries store key-value pairs.
person = {
"name": "Alice",
"age": 25,
"city": "Paris"
}print(person["name"]) # Alice
print(person["age"]) # 25
Create a dictionary student with keys "name" (value: "Alex") and "grade" (value: 85). Print the name.
Downloading Python… (one-time, ~10 MB)
This runs entirely in your browser and is cached for next time.