python字典遍历演示代码
#the key and corresponding value can be retrieved at the same time using the #iteritems() method. knights = {'Key 1': 'value 1', 'key 2': 'value 2'} for k, v in knights.iteritems(): print k, v
python字典遍历演示代码
#the key and corresponding value can be retrieved at the same time using the #iteritems() method. knights = {'Key 1': 'value 1', 'key 2': 'value 2'} for k, v in knights.iteritems(): print k, v