In [1]:
# Assignment 1
# 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()
def my_mean_function (listx):
a = 0
count = 0
for element in listx:
a += element
count += 1
return (a / count)
sample_list =([1,2,3,4,5,6,7,8,9,10])
print(my_mean_function(sample_list))
In [ ]: