python 字典遍历

版权声明:欢迎转载。转载请注明地址:https://blog.csdn.net/weixin_32820767 https://blog.csdn.net/weixin_32820767/article/details/82348714

python 字典遍历:

a = {'a': '1', 'b': '2', 'c': '3'}
for key,value in a.items():
       print(key, value)

打印
a:1
b:2
c:3

猜你喜欢

转载自blog.csdn.net/weixin_32820767/article/details/82348714