7/9 Variance


#1



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


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)


#2

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.


#3

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


#4