For a list of of tuples:
my_dict.items()
If all you're doing is iterating over the items, however, it is often preferable to use dict.iteritems()
, which is more memory efficient because it returns only one item at a time, rather than all items at once:
for key,value in my_dict.iteritems():
#do stuff