[Python] Manipulate Data with Dictionaries in Python

Dictionaries may be familiar to you as hash maps. In this lesson, you will learn how to create them, get the values, and delete elements from the dictionary.

person = {}
person['name'] = "Wan"
person['age'] = 29

for key, value in person.items():
    print(key, value)

# ('name', "Wan")
# ('age', 29)
原文地址:https://www.cnblogs.com/Answer1215/p/8020173.html