What is the difference btn my code and the solution and what is the reason mine is wrong?

my code:

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

the solution:

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