98.1k views
5 votes
Write a statement that assigns the variable avg_price with the average of the elements of prices.

User Rachele
by
3.6k points

1 Answer

5 votes

Answer:

avg_price = sum(prices) / len(prices)

Step-by-step explanation:

using the sum command to add all of the values of the prices dividing by the number of prices

User FeRD
by
3.3k points