27.5k views
5 votes
The sales of last 6 months are stored in a list,

as follows
list1 = (12500, 35000, 12000, 40000, 55000,
60000]
How can you calculate the average sales?​

User Bing Lu
by
4.2k points

1 Answer

4 votes

list1 = [12500, 35000, 12000, 40000, 55000,60000]

print(sum(list1)/len(list1))

We take the sum of all the elements in the list and divide the sum by the quantity of the elements. You can put however many elements in this list and you'll always get the average using the algorithm above.

User Eric Kolotyluk
by
4.2k points