首页
科技
登录
6mi
u
盘
搜
搜 索
科技
python字典 items函数
python字典 items函数
科技
2022-07-16
107
items函数会将字典以数列形式返回,且元素是键值对应的元组。
d = {'one': 1, 'two': 2, 'three': 3} print(d.items()) dict_items([('one', 1), ('two', 2), ('three', 3)])
有一个问题在于python3.0后还会输出dict_items()而不是单纯的数列
转载请注明原文地址:https://blackberry.8miu.com/read-9484.html
最新回复
(
0
)