Skip to content

Instantly share code, notes, and snippets.

@julia-git
Created August 14, 2021 21:36
Show Gist options
  • Save julia-git/0b6d45574707d94516adc07f0a088c68 to your computer and use it in GitHub Desktop.
Save julia-git/0b6d45574707d94516adc07f0a088c68 to your computer and use it in GitHub Desktop.
veggies
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