python 字典输出键值对

 

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

 

posted @ 2018-11-19 10:25  anobscureretreat  阅读(8252)  评论(0编辑  收藏  举报