# 8/9 HELP Standard Deviation error : 'float' object isn't iterable

#1

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

total = 0

return average

variance = 0
variance = variance + (average - n)**2

return variance **0.5

why is it showing "grades_std_deviation(0.0) raise an error: 'float' object isn't iterable" ??
how can I fixed it><

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

#float total
total = 0

return average
'''
print "============="
print "============="
'''
print "\tAverage:\t" + str(average)
print "=1=========="
variance = 0
variance = variance + (average - n)**2
# print variance
print "=2=========="
print "\tvariance:\t" + str(float(variance) / len(grades))
print "=3=========="

print "=4= The std_deviation is:"
return variance **0.5

#3

For this portion, following the instructions to the dot helps.

return variance ** 0.5

I have no real idea why it will generate an iteration error if the variance variable is defined in the grades_std_deviation versus outside.

#4

@indecisively,
as indetation is very important in the Python code structure,