How to Iterate a Dictionary in Python: keys, values, items, and the Set-Op SuperpowerTo iterate a dictionary in Python you have four patterns: for key in my_dict (keys, the default), for key in my_dict.keys() (the same, explicit), for value in my_dict.values() (values only), and for key, value in my_dict.items() (pairs). What most tutorials miss: the objects returned by .keys(), .values(), and .items() are not lists.