Skip to Content
A Day at the Supermarket
This is KEY!

You can also use a for loop on a dictionary to loop through its keys with the following:

# A simple dictionary d = {"foo" : "bar"} for key in d: print d[key] # prints "bar"

Note that dictionaries are unordered, meaning that any time you loop through a dictionary, you will go through every key, but you are not guaranteed to get them in any particular order.



Use a for loop to go through the webster dictionary and print out all of the definitions.

Folder Icon

Take this course for free

Already have an account?