To get this task done we had to make a programm in python that would ask the user for 10 numbers, then to save those numbers in a list. Those numbers had to be floating point. After we get that done, we had to print the total, the average and the standard deviation of those numbers. The trouble i found doing this is that i never heard of standard deviation and when i look for it, i kind of missunderstood the meaning. But i found an awesome page which you can go by clicking here, that help understand what it it. I used two for loops and the math module.

This is my code:

#Jorge Fernando Saldaña Cabal
#A01350730
import math
count = 0.0
lista = []
for i in range(10):
x = int(input(‘Introduce a number: ‘))
count = count + x
lista.append(x)

average = count/10
print(‘The sum of your numbers is: ‘, count)
print()
print(‘The average of your list of numbers is: ‘, average)
print()
resdev = 0.0
for i in range(10):
dev = average-lista[i]
dev = dev ** 2
resdev = resdev + dev
varianza = resdev/10

deviation = math.sqrt(varianza)

print(‘The deviation standard of your numbers is: ‘, deviation)

Any comments feel free to comment.

CC BY 4.0 Standard deviation by fersabal is licensed under a Creative Commons Attribution 4.0 International License.