FAQ: Learn Python - Exam Statistics - Standard Deviation

This community-built FAQ covers the “Standard Deviation” exercise in Codecademy’s lessons on Python.

FAQs for the Codecademy Python exercise Standard Deviation:

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about Python in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

Not seeing your question? It may still have been asked before – try (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

Other FAQs

The following are links to additional questions that our community has asked about this exercise:

  • This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
  • Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
  • This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!

2 posts were split to a new topic: Why Don’t we Subtract 1 When Looking for Standard Deviation?

Im keep getting error message no matter what I do.
Here is the code that ive writen:

def grades_std_deviation(variance):
return variance ** 0.5
variance = grades_variance(grades)
print grades_std_deviation(variance)

here is the error message:

Traceback (most recent call last):
File “python”, line 20, in
NameError: name ‘grades_variance’ is not defined

and here is the solution for this excercise:

def grades_std_deviation(variance):
return variance ** 0.5
variance = grades_variance(grades)
print grades_std_deviation(variance)

and YES, they are ABSOLUTELY THE SAME, but one provided by clicking the solution button somehow works. Please help!

(1) When you post code, please make use of the </> icon in the menu bar atop the text box you are typing in, in order to present properly-formatted, readable code.

(2) For a “My code is exactly the same as the solution, yet it does not work” post, it is probably best to post screenshots of your effort and the provided solution.

capture

I had the same issue and I changed the print argument by calling the grades_variance function on grades and it works!

def grades_std_deviation(variance):
return variance ** 0.5
variance = grades_variance(grades)

print grades_std_deviation(grades_variance(grades))

line 30 seems unreachable, being inside the body of the function and after the return

you could then also pass variance (result of calling grades_variance) as argument for grades_std_deviation.

Just taking two steps what you now do in one step on line 32.