Hey guys!

```
# Instructions
# On line 18, define a new function called grades_variance() that accepts one argument, scores, a list.
# First, create a variable average and store the result of calling grades_average(scores).
# Next, create another variable variance and set it to zero. We will use this as a rolling sum.
# for each score in scores: Compute its squared difference: (average - score) ** 2 and add that to variance.
# Divide the total variance by the number of scores.
# Then, return that result.
# Finally, after your function code, print grades_variance(grades).
Here's my code:
def grades_variance(scores):
average = grades_average(scores)
variance = 0
for score in scores:
variance += (average - score) ** 2
return variance / len(scores)
print(grades_variance(grades))
```

I don’t know what’s wrong with my code. I tried using a new variable and it worked:

```
def grades_variance(scores):
average = grades_average(scores)
variance = 0
for score in scores:
newvar = (average - score) ** 2
variance += newvar
return variance / len(scores)
```

What’s wrong with the first code? Thanks for the help!