 # Problem in Standard Deviation exrecise

Hi!
I am learning Python and I am in Exam Statistic lesson, Standard Deviation

it is pretty straight forward exerecise, so I wrote down the following code and in the monitor a message says error:
Traceback (most recent call last): File “python”, line 30, in <module> File “python”, line 27, in grades_std_deviation TypeError: unsupported operand type(s) for ** or pow(): ‘list’ and ‘float’

my code:

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

total = 0
for score in scores:
total += score

return average

variance = 0
for score in scores:
variance += (average - score)**2
variance = variance / float(len(scores))
return variance

return variance ** 0.5 #line 27

``````

when I checked the solution to this exercise, they did the same thing in def grades_std_deviation.
can you help me understand what I did wrong?
Thank you!

1 Like

you missed this bit of the instructions:

Finally print the result of calling grades_std_deviation(variance)

we calculate the variance of the grades, then using the variance, we calculate the standard deviation.

1 Like

Thank you for your help! I understand my mistake!!

1 Like