Reputation: 61
How to complete the blanks to get the output:
red shirt
blue shirt
white shirt
blue jeans
black jeans
Code:
wardrobe = {"shirt":["red","blue","white"], "jeans":["blue","black"]}
for __:
for __:
print("{} {}".format(__))
Upvotes: 0
Views: 123
Reputation: 4471
wardrobe = {"shirt": ["red", "blue", "white"],
"jeans": ["blue", "black"]}
for item, colors in wardrobe.items():
for color in colors:
print("{} {}".format(color, item))
Upvotes: 2
Reputation: 6112
for key in wardrobe:
for color in wardrobe[key]:
print("{} {}".format(color, key))
Upvotes: 2