Question: Question 1 : Write a function get _ total _ price ( cart ) that takes a list of dictionaries where each dictionary represents an

Question 1: Write a function get_total_price(cart)
that takes a list of dictionaries where each dictionary
represents an item in a shopping cart.
Each dictionary has two keys: "item" (the name of the product as a string)
and "price" (the price of the product as a float).
The function should return the total price of all items
in the cart. If the cart is empty, the function should
return 0.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!