This forum is now read-only. Please use our new forums! Go to forums

Close banner
0 points
almost 10 years

5/9 "can't assign to function call"

Something seems to be wrong here but I can’t really figure out what. Console window says “File “python”, line 23 - SyntaxError: can’t assign to function call”

I think it’s some little mistake I haven’t noticed, any help would be apperciated.

Line 23 = “ sum(numbers) = total “

My code:

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


Write a function average that takes a list of numbers and returns the average.

Define a function called average that has one argument, numbers.

Inside that function, call the built-in sum() function with the numbers list as a parameter.

Store the result in a variable called total.

Like the example above, use float() to convert total and store the result in total.

Divide total by the length of the numbers list. Use the built-in len() function to calculate that.

Return that result.

Answer 53a9bd0c9c4e9d00030006c3

4 votes


To assign a variable the variable must be in front of whatever you assigning it to. For example it should be “ total = sum(numbers).”


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

Submitted by Owen Cruikshank
almost 10 years


Owen Cuikshank, Thank you! Finally I can get back to learning.

Nick Vanadium almost 10 years

Couldn’t for the life of me figure out why I wasn’t able to assign the variable

Sarah almost 10 years


Autumn Smith about 9 years

thank you!!!