# 7. Variance - Nothing works?

#1

I'm working on Lesson 7: Variance: https://www.codecademy.com/courses/python-intermediate-en-7mgOa/2/1?curriculum_id=4f89dab3d788890003000096

The error message I'm getting is this:

Oops, try again.

I've run it several times, and the list in the error message will have more or less items, such as

``````Oops, try again.
grades_variance([6, 5, 7, 5, 6, 3, 5, 3]) returned 1 instead of the expected: 1.75``````

or

Oops, try again.

Here's my code, which I've literally copied from another thread to be sure it's correct:

``````[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
result = variance/len(scores)
return result

``````

Am I doing something wrong, or is this some kind of glitch? I have no idea how to identify a pattern in those error messages.

#2

Your function, grades_average, doesn't output a float (hence why you won't have a bunch of numbers after your decimal). Simply add float to this line:

``````average = sum_of_grades / len(grades)
# add float so it looks like this: