# 7. Variance

Hi, Im not passing even tough I get the results
Im supposed to get ( I tested the input which the console returns me
with a error message). I dont find a mistake… Any suggestions?

<Below this line, add a link to the EXACT exercise that you are stuck at.>
Oops, try again.
grades_variance([8, 5, 6, 8, 0, 5, 6, 3, 7]) returned 5644.2473701512 instead of the expected: 5.7777777778

<What do you expect to happen instead?>

```python

grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]

total = 0

return durchschnitt

variance = 0
for score in scores:
variance += (average - score) ** 2
total_variance = variance/float(len(scores))

``<do not remove the three backticks above>``

Hint: Should you get the average of the globally defined `grades`, or the grades that have been passed to you as an argument `scores`?

``average = grades_average(grades) # reconsider this line``

ouuu okay… thanks!!!

A post was split to a new topic: Variance

i didnt get youwhat you have said…!?

If you call `grades_average` like this:

``````grades_average(my_scores)
``````

where each different list passed to it gives a different output, it makes sense for `grades_average` to compute the average of the grades list passed to it as an argument.

this is what i was missing…

total_variance = variance/float(len(scores))

thank you

I have a problem:

``````grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]

total = 0

return average

variance = 0
for score in scores:
variance += (average - score) ** 2
a =  variance / scores
return a
``````Traceback (most recent call last):