This work in my idle, but not work in codeacademy. Where is error?
Oops, try again. Your code appears to raise an error, see the console window for the error message!
Hi @kopevgale ,
The reason that your code works in IDLE, but not when you submit it to Codecademy, is that you departed from the specifications requested in the instructions. When Codecademy passes a
float to your
grades_std_deviation function as part of its testing, your code passes it on to your
grades_variance function, as an argument, where it is treated as a list. That throws the error.
To get your solution to pass Codecademy's test, you will need to carefully reorganize your code so that it conforms to the instructions. For example, the
grades_std_deviation function should simply return the square root of the variance, as follows ...
def grades_std_deviation(variance): return variance ** 0.5
To get the above to work with your other functions, you will need to make other adjustments to the structure of your code. Note, by the way, that you have more than one version of the
grades_std_deviation function, which is confusing, and can lead to buggy code.