Python怎么同时遍历返回字典的键和值?

1 个回答|76 次阅读
Coco老师 - 科普专家
擅长:编程教育
dict1 = {
  "name": "feifei",
  "gender": "girl",
  "age": 28
}
for x,y in dict1.items():
    print(x,y)

执行结果:

name feifei
gender girl
age 28