Write a code that takes numbers from the user as a list. (User can enter as many numbers as he wants). Then, find mean and standard deviation of this list of numbers.

Sample Output 
Enter numbers: 1 2 3 5 4 2 3 2 1 5 8 4 5
The mean is 3.4615384615384617
The standard deviation is 1.983909634004895

Write a code that takes numbers from the user as a list User can enter as many numbers as he wants Then find mean and standard deviation of this list of numbers class=

Respuesta :

nums = list(map(int, input().split()))

mean = sum(nums)/len(nums)

print("The mean is",mean)

values = 0

for x in nums:

   values += abs(x - mean)**2

print("The standard deviation is",(values / (len(nums)-1))**0.5)

I wrote my code in python 3.8. I hope this helps.

RELAXING NOICE
Relax