Write a function that takes in a list of numbers and outputs the mean of the numbers using the formula for mean. Do this without any built-in functions like sum(), len(), and, of course, mean()
In [1]:
def sumMean(list):
sum = 0
count = 0
for item in list:
sum = sum + item
count = count + 1
return sum/count
In [8]:
test_data = [1,2,3]
sumMean(test_data)
Out[8]: