Stuck on Standard deviation!


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

def print_grades(grades_input):
for grade in grades_input:
print grade

def grades_sum(scores):
total = 0
for score in scores:
total += score
return total

def grades_average(grades_input):
sum_of_grades = grades_sum(grades_input)
average = sum_of_grades / float(len(grades_input))
return average

def grades_variance(scores):
average= grades_average(scores)
for score in scores:
return variance/len(scores)
print grades_variance(grades)

def grades_std_deviation(variance):
return variance**0,5

print grades_std_deviation(variance)

Define a function, grades_std_deviation, that takes one argument called variance.

return the result of variance ** 0.5

After the function, create a new variable called variance and store the result of calling grades_variance(grades).

Finally print the result of calling grades_std_deviation(variance).

grades_std_deviation(20.25) returned (1.0, 5) instead of the expected: 4.5


Your grades_std_deviation returns variance**0,5 instead of variance**0.5


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.