Https://www.codecademy.com/courses/learn-python/lessons/student-becomes-the-teacher/exercises/its-okay-to-be-average-

Hi guys

https://www.codecademy.com/courses/learn-python/lessons/student-becomes-the-teacher/exercises/its-okay-to-be-average-

I don’t quite understand what I have done wrong. I have used the float function just like in the example.

Here is the error message: File “python”, line 23
SyntaxError: can’t assign to function call

My code:

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

What am I doing wrong?

2 Likes

You inverted the order:

would be:

total = float(total)

Hope this helps :grinning:

2 Likes

Thanks! That fixed the problem.

2 Likes