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

def print_grades(grades):

for grade in grades:

print grade

def grades_sum(grades):

total = 0

for grade in grades:

total += grade

return total

def grades_average(grades):

sum_of_grades = grades_sum(grades)

average = sum_of_grades / float(len(grades))

return average

def grades_variance(scores):

average = grades_average(scores)

v = 0

for i in scores:

v = v + (average - i)**2

return v/len(scores)

def grades_std_deviation(variance):

variance = grades_variance(grades) ** 0.5

return variance

grades_sum(grades)

print grades_average(grades)

print grades_variance(grades)

print grades_std_deviation(grades)

I get the error "Oops, try again. grades_std_deviation(1524.6666666666667) returned 18.2776094147 instead of the correct value 39.0469802503" for the above code.

I suspect that it's due to the fact that for the function grades_std_deviation(variance), variance is always equal to **grades_variance(grades) ** 0.5** regardless what the input is.

However, I am not able to find a solution to solve this problem.

Can anyone offer some help please?