EN
Python - access dictionary items
0
points
In this article, we would like to show you how to access dictionary items in Python.
To get the value of a "age"
key in my_dict
we refer to the key name wrapped with square brackets.
my_dict = {
"id": 1,
"name": "Tom",
"age": 25
}
result = my_dict["age"]
print(result) # 25
Output:
25