In [26]: test = {} In [27]: test[\"apple\"] = \"green\" In [28]: test[\"banana\"] = \"yellow\" In [29]: test[\"orange\"] = \"orange\" In [32]: for fruit, colour
In Python 2 you'd do:
for fruit, color in test.iteritems(): # do stuff
In Python 3, use items() instead (iteritems() has been removed):
items()
iteritems()
for fruit, color in test.items(): # do stuff
This is covered in the tutorial.