Apr-29-2022, 10:12 PM
Where are you saving input? candy only reference the last input.
Why does output = candy_calories.get(cal, "!")? candy_calories values are all numbers. Why do you want to return a string if cal is not a key in the dictionary?
Python has a built in function that will give you the sum of a list of numbers.
Why does output = candy_calories.get(cal, "!")? candy_calories values are all numbers. Why do you want to return a string if cal is not a key in the dictionary?
Python has a built in function that will give you the sum of a list of numbers.