# Standard Deviation

#1

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

result = float(x) ** 0.5
return result

the error says 'float' object is not iterable

1. WHY WON'T THIS WORK?
2. WHY DO I HAVE TO x = grades_variance(variance) outside the function?

``Replace this line with your code.``

#2

All you are required to is raise the variance by 0.5 and return it,

`return variance ** 0.5`

you don't need a variable for that.

But remember on a new indentation level you need to set a variable equal the function grades_variance with the argument (grades),

`example_var = grades_variance(grades)`

#3

I agree I am a little too succinct to use a variable for returning the result!

Re: Edited questions
1. What does this error float object not iterable mean? for ex in this case
2. Why can't I store the variance in a variable that is inside the function? and obtain the deviation by simply calling the grades..

#4

float and int objects are not iterable.

Well you can store a function call to another function inside a different function. The question is, why would you like to do that?

#5

"Well you can store a function call to another function inside a different function." >> I don't understand this. Can someone with better communication skills break it down to me please?

Because then I get to call the function using just the print command, and when I call the function anytime again, I don't have to add the value of variance to it. Just the print, call. So?

#6

What I mean by this,

is for example,

``````def add(x,y):
return x + y