当前位置 : 主页 > 编程语言 > java >

python dict 字典遍历 获取所有的值

来源:互联网 收集:自由互联 发布时间:2023-03-22
# 定义字典d = {"name": "pyhui", "age": 22}# 遍历字典只拿值vals = d.values()print(vals)for v in vals: print(v)for temp in d.values(): print(temp)
# 定义字典d = {"name": "pyhui", "age": 22}# 遍历字典只拿值vals = d.values()print(vals)for v in vals: print(v)for temp in d.values(): print(temp)
上一篇:python dict 字典遍历 得到键与值
下一篇:没有了
网友评论