Continuing the discussion from Variance:

https://www.codecademy.com/courses/python-intermediate-en-7mgOa/2/1?curriculum_id=4f89dab3d788890003000096

Thanks for your hint .Corrected the code.But now throwing a calculation error :- "Oops, try again. grades_variance([9, 8, 0, 5]) returned 0.0625 instead of the expected: 12.25"

The revised code is as below:

```
[100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]
def grades_sum(scores):
sum=0
for i in scores:
sum +=i
print sum
return sum
def grades_average(grades):
total= grades_sum(grades)
leng=len(grades)
if total%leng==0:
average=total/leng
else: average=total/float(leng)
print average
return average
def grades_variance(scores):
average= grades_average(scores)
variance=0
for i in scores:
variance=(average - i) ** 2
return variance/len(scores)
grades_variance(grades)
```