The Variance


#1

not sure what mistake I made here because it looks like it shoudl work

can someone help me see what is wrong?

thanks

<>

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

</>


#2

here:

lala = variance/len(scores)

lala (the grade variance) should be calculated after getting the variance, so lala should be outside the loop

print grades_variance(grades) should be outside the function, given the function call execute the function

all your problems have to do with indent


#3

oh my gosh…

thanks so much


#4