# # demo.py # # (put stuff for author etc here) from math import sqrt def main(): numbers = input("What is the list of numbers? ") total = 0 count = 0 for n in numbers: total = total + n count = count + 1 print "The total is ", total average = float(total)/count print "The average is", average # OK, now find the standard deviation total = 0 for n in numbers: total = total + (n - average)**2 variance = total/count standard_deviation = sqrt(variance) print "The standard deviation is ", standard_deviation main()