def average(numList): # the average of a list of numbers is eqaul to # sum(list) / count(numbers in the list) # count is going to keep track of the sum, it starts at 0 count = 0 print("The list we are using is " + str(numList)) # for every number in the numList for number in numList: print("Count is at " + str(count) + " and we are adding " + str(number)) # add it to the current count and set count to the new sum count = count + number # once the above for loop is complete we will have added all of the numbers in the list avg = count / len(numList) # return the avg return avg # average(list) evaluates to a single number which the average function returns # myAvg is set to that number myAvg = average([1,2,3,4,5,6,7,8,9,10]) print("myAvg = " + str(myAvg))