Created
August 14, 2021 21:36
-
-
Save julia-git/0b6d45574707d94516adc07f0a088c68 to your computer and use it in GitHub Desktop.
veggies
This file contains 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
veg_dict = {'cabbage': 2.87, 'carrot': 1.59, 'spinach': 3.33, 'asparagus': 2.54, 'artichoke': 3.00, 'lettuce': 2.43} | |
order1 = {'cabbage': 2, 'spinach' : 3, 'artichoke': 5} | |
order_total = 0 | |
for veggie, quantity in order1.items(): | |
order_total += veg_dict[veggie] * quantity | |
print(order_total) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment