Python please: Write a program to calculate the total calories in a lunch. Each lunch comes with a pickle that is 7 calories. A dictionary with each additional food item and the corresponding calorie count has been provided. Up to four items can be selected. A '-' signifies an additional item was not selected. Output all selected items along with the corresponding calories and then the total calories for the entire lunch. Example: If the input is Wrap Soda French Fries Cookie the output is ZyDeli Lunch Counter Pickle calories -- 7 cal Wrap -- 890 cal Soda -- 160 cal French Fries -- 365 cal Cookie -- 190 cal ---- Total calories: 1612 cal Example: If the input is French Fries Soda - Cookie the output is ZyDeli Lunch Counter Pickle calories -- 7 cal French Fries -- 365 cal Soda -- 160 cal Cookie -- 190 cal ---- Total calories: 722 cal
Python please:
Write a program to calculate the total calories in a lunch. Each lunch comes with a pickle that is 7 calories. A dictionary with each additional food item and the corresponding calorie count has been provided. Up to four items can be selected. A '-' signifies an additional item was not selected.
Output all selected items along with the corresponding calories and then the total calories for the entire lunch.
Example: If the input is
Wrap Soda French Fries Cookie
the output is
ZyDeli Lunch Counter Pickle calories -- 7 cal Wrap -- 890 cal Soda -- 160 cal French Fries -- 365 cal Cookie -- 190 cal ---- Total calories: 1612 cal
Example: If the input is
French Fries Soda - Cookie
the output is
ZyDeli Lunch Counter Pickle calories -- 7 cal French Fries -- 365 cal Soda -- 160 cal Cookie -- 190 cal ---- Total calories: 722 cal
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images