python 字典输出键值对

d = {'x': 10, 'y': 20, 'z': 30}   
for dict_key, dict_value in d.items():  
    print(dict_key,'->',dict_value)

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/9981729.html