It's ok to be average---Why is my code wrong?


#1

def average(numbers):
total = sum(numbers)
total = float(numbers)
return total / len(numbers)

Oops, try again. Make sure you have defined get_average

But the following works:

def average(numbers):
total = sum(numbers)
return float(total) / len(numbers)


#2

you just re-define total here, so total is once the sum of numbers, then it's the float of numbers.


#3

Thank you, so it was a typo, my bad.:slightly_smiling:


#4