python dict traversal

rs=dict()
rs['item1'] = 'item1'
rs['item2'] = 'item2'

for k,d in rs.items():
    print k,d


for k in rs.keys():
     print k,rs[k]

 

posted @ 2015-12-15 12:34  hao.ma  阅读(158)  评论(0编辑  收藏  举报