def grades_std_deviation(variance):  
    return variance**0.5

print grades_std_deviation(variance)

this in a incorrect code, the error returned is "grades_std_deviation(6.1875) returned 18.2776094147 instead of the expected: 2.4874685928"

the right one should put "variance=grades_variance(grades)" outside of the defined function.

and why there is a difference when i put the " variance=grades_variance(grades)" outside of the defined function?
and what is the difference? i think no matter the "variance=grades_variance(grades)" is outside of function or not, the "print grades_std_deviation(variance)" and the function will call it anyway......

wish a explanation on that

thank you so much !!


Hello @zoezhang1992foxmail,

Can you attach a link to the exercise you are doing? Thanks!


i have attached the link, thank you so much !


Hello there, @zoezhang1992foxmail,

The grades_std_deviation() function takes the variance of a list. You do not need to call grades_variance() on it, you simply have to return variance**0.5 and your code will be good to go.