zl程序教程

您现在的位置是:首页 >  后端

当前栏目

[Python] Manipulate Data with Dictionaries in Python

Python in with Data
2023-09-14 09:00:51 时间

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)