遍历字典获取对应的key和对应的值。(v,k)for k,v等价于v,k=k,v值交换。
dic = {'a': '1', 'b': '2', 'c': '3'} for key,value in dic.items(): print(key+':'+value) a:1 b:2 c:3