Dictionary (Python)

A Python dictionary stores data as key–value pairs in curly braces. You look values up by their key instead of by position.

Python

Examples

Python

user = {"name": "Ana", "age": 30}
print(user["name"])

Output:

Ana

Learn it in a lesson

See also

Back to the Dictionary