[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)

 

posted @ 2017-12-11 01:34  Zhentiw  阅读(192)  评论(0编辑  收藏  举报