PythonDictionaryitems
values

itemsDictionary

update

Returns a view of (key, value) pairs in the dictionary.

Syntax

dict.items()

Example

Enter values below to update the example in real time.

person
for
key
value
items
print
name
Alice
person = {"name": "Alice", "age": 30}
for key, value in person.items():
    print(f"{key}: {value}")
# name: Alice
# age: 30