Source Code:
(back to article)
d = {'a': 1, 'b': 2, 'c': 3} # Using items() print(d.items()) # Output: [('a', 1), ('b', 2), ('c', 3)] # Using iteritems() for key, value in d.iteritems(): print(key, value) # Output: # a 1 # b 2 # c 3
Result:
Report an issue