7/9 Variance



My codes gives me error 'incorrect syntax' pointing to print in print grades_variance(grades) .
But why?

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


Hi @tagslayer42721,

Check the parentheses here ...

return variance/float(len(scores)

Whenever a SyntaxError is identified at the beginning of a line, check the previous line of code.


Thank you very much. That solved my problem. The way it shows next line is miss guiding :smiley: