I need help, 16/7


this is my code:
def grades_variance(scores):
average = grades_average(grades)
variance == 0
for score in scores:
new_average = (average -score) ** 2
variance += new_average
result = variance / float(len(scores))
return result
print grades_variance(scores)

and it gives me an error:
Traceback (most recent call last):
File "python", line 26, in
File "python", line 20, in grades_variance
UnboundLocalError: local variable 'variance' referenced before assignment

I don't know what's wrong, I follow the instructions exactly.


You used

variance == 0

but to assign a value you need to use a single = , the == operator is for comparisons.