Question: python languge. plese send the code as a text not picture. Write a Python function totalWeight() that gets as parameter a dictionary containg food names
Write a Python function totalWeight() that gets as parameter a dictionary containg food names as keys and their weight (in kg) as values. The function will return the sum of weights all food in the dictionary. Example: if the dictionary ("apple": 1.5, "carrot": 0.8,"onion": 1.1) is given as parameter, the function will return 3.4 (= 1.5 +0.8 +1.1). 1 " B
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
