Created
March 23, 2021 07:42
-
-
Save AnisahTiaraPratiwi/f63ef7a219cb46894add7f2d9af93d9f to your computer and use it in GitHub Desktop.
Now, it's your turn! Have a go at iterating over a dictionary! Complete the code to iterate through the keys and values of the cool_beasts dictionary. Remember that the items method returns a tuple of key, value for each element in the dictionary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cool_beasts = {"octopuses":"tentacles", "dolphins":"fins", "rhinos":"horns"} | |
for animal, thing in cool_beasts.items(): | |
print("{} have {}".format(animal, thing)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment