Question: 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 [34]:
def finding_mean(list_of_numbers):
    sum = 0
    for item in list_of_numbers:
        sum += item
    number_of_numbers = len(list_of_numbers)
    return sum/number_of_numbers

In [35]:
finding_mean([1,2,3])


Out[35]:
2.0

In [36]:
finding_mean([1000,3894385,749853])


Out[36]:
1548412.6666666667

In [ ]: