Problem:


Standard Deviation

  You have final scores of an examination for n students. Calculate standard deviation of the scores s1, s2 ... sn.

The variance &alpha;2 is defined by  

&alpha;2  = (&sum;ni=1(si - m)2)/n

  where m is an average of si.

  The standard deviation of the scores is the square root of their variance.
  

Input

  The input consists of multiple datasets. Each dataset is given in the following format:

n
s1 s2 ... sn

  The input ends with single zero for n.

Output

  For each dataset, print the standard deviation in a line. The output should not contain an absolute error greater than 10-4.

Constraints

n ≤ 1000

0 ≤ si ≤ 100 

Sample Input

5
70 80 100 90 20
3
80 80 80
0

Sample Output

27.85677655
0.00000000



Sample input:
5
70 80 100 90 20
3
80 80 80
0


Sample output:
27.85677655
0.00000000

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !
import sys
import collections
#import numpy
import statistics
import unittest


def calculate_standard_deviation():
    lines = sys.stdin.readlines()
    data = []
    i = 0
    while(i < len(lines)):
        if(int(lines[i].rstrip()) == 0) :
            break
        else:
            data.append([ int(score) for score in lines[i+1].rstrip().split() ])
            i += 2

    for scores in data:
        mean = statistics.mean(scores)
        
        print(statistics.pstdev(scores))
#        print(numpy.std(scores))

def __input_error():
    print("input error")
    return -1

class __TestValueClass(unittest.TestCase):
    def testEqual(self,func,tuples):
        self.testFunction(self.assertEqual,func,tuples)
    
    def testFunction(self,assertfunc,func,tuples):
        #tuples[index] = ([*arguments of func], compared value)
        for item in tuples:
            try:
                if isinstance(item[0], collections.Iterable):
                    assertfunc(func(*item[0]),item[1])
                else:
                    assertfunc(func(item[0]),item[1])
            except Exception as msg:
                swidth = 15
                print("="*50)
                print("-- Assertion Error in '" + func.__name__ + "' --")
                print("arguments".ljust(swidth)+":",item[0])
                print("compared value".ljust(swidth)+":",item[1])
                print("message".ljust(swidth)+":")
                print(msg)
                sys.exit()
        print(func.__name__,": succeeded")
        
#test
if __name__ == "__main__" :

    calculate_standard_deviation()
#    test = __TestValueClass()

Submission status: Accepted

Solution code:
import math


def sd(n, students, average):
    rlt = 0
    for i in students:
        rlt += (i - average) ** 2

    rlt = rlt / n
    return math.sqrt(rlt)


if __name__ == '__main__':
    while True:
        n = int(input())
        if not n:
            break
        students = list(map(int, input().split()))

        average = sum(students) / n
        ans = sd(n, students, average)
        print(round(ans, 8))

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    s = [int(i) for i in input().split(" ")]
    m = sum(s) / n
    print("{:.8f}".format(math.sqrt(sum([(x-m) ** 2 for x in s]) / n)))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import statistics
import math

allData = []

while True:
    n = int(input())
    if n == 0:
        break
    data = input().split()
    for i in range(len(data)):
        data[i] = int(data[i])
    allData.append(data)

for x in allData:
    print(math.sqrt(statistics.pvariance(x)))

Submission status: Accepted

Solution code:
#ITP1_10-C Standard Deviation
while True:
    n= int(input())
    if n==0:
        break
    s = input().split(" ")
    mean = 0.0
    for i in range(n):
        mean += float(s[i])
    mean /= n
    cov = 0.0
    
    for i in range(n):
        cov+=((float(s[i])-mean)**2)/n
    print(cov**0.5)

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if 0 == n:
        break

    points = list(map(int, input().split(' ')))

    m = sum(points)/n
    s = math.sqrt(sum([ (s - m)**2 for s in points ])/n)

    print('{:.5f}'.format(s))

Submission status: Accepted

Solution code:
import math

def hensa(n, S):
 m = sum(S)/n
 x = 0
 for i in S:
  x += (i - m) ** 2
 hensa = math.sqrt(x / n)
 return hensa

n = int(input())
while n != 0:
 S = list(map(int, input().split()))
 print("{0:04f}".format(hensa(n, S)))
 n = int(input())

Submission status: Accepted

Solution code:
import math
n = int(input())
while n:
    s = list(map(float, input().split()))
    m = sum(s) / n
    tmp = 0
    for si in s:
        tmp += (si - m) ** 2
    print(math.sqrt(tmp / n))
    n = int(input())

Submission status: Accepted

Solution code:
import math
n = int(input())
while n:
    s = list(map(int, input().split()))
    m = sum(s) / n
    tmp = 0
    for si in s:
        tmp += (si - m) ** 2
    print(math.sqrt(tmp / n))
    n = int(input())

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    kei = 0
    for p in s:
        kei += p

    m = kei / n

    a = 0
    for p in s:
        a += ((p - m)**2) / n

    import math
    h = math.sqrt(a)
    print(h)

Submission status: Accepted

Solution code:
import math
while True:
    n=int(input())
    if n==0: break
    l = list(map(int, input().split()))
    s=0
    for i in l:
        s+=((i-sum(l)/n)**2)
    print("{0:.8f}".format(math.sqrt(s/n)))

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    s = input().split(" ")
    t = list(map(int,s))
    goukei = 0
    for i in range(n):
        goukei += t[i]
    m = goukei / n
    sagoukei = 0
    for i in range(n):
        sagoukei += (t[i]-m)**2
    a = math.sqrt(sagoukei/n)
    print(a)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break

    s = [int(s) for s in input().split()]
    ave = sum(s) / n
    a = 0
    for N in s:
        a += (N - ave)**2
    
    a = math.sqrt((a / n))
    print(a)

Submission status: Accepted

Solution code:
import statistics

while True:
    n = int(input())

    if n == 0:
        break

    s = map(int, input().split())

    print('{:.5f}'.format(statistics.pstdev(s)))

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    S=[]
    S=list(map(int,input().split()))
    m=sum(S)/n
    a=0
    for i in range(n):
       a+=(S[i]-m)**2
    a/=n
    print(a**0.5)

Submission status: Accepted

Solution code:
import math
while 1:
    n=int(input())
    if n==0:
        break
    ave=0.0
    aru=0.0
    m=[float(i) for i in input().split()]
    for i in range(n):
        ave=ave+m[i]
    ave=ave/n
    for i in range(n):
        aru=aru+(m[i]-ave)*(m[i]-ave)
    aru=math.sqrt(aru/n)
    print("%.5f"% aru)

Submission status: Accepted

Solution code:
import math

while True:
    n = input()
    if(n==0):
        break
    l = map(float, raw_input().split())
    varience = sum(map(lambda x: (x - (sum(l)/n))**2 / n, l))
    print math.sqrt(varience)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
?¨??????????

n ????????????????????????????????§????????°???????????°???????¨?????????£??????
????????????????????????s1, s2 ... sn??¨????????¨??????????¨??????????????±???????????????°????????????????????????

??????????????????????????¨????????°????????£?±2?????\???????????§???????????????

?±2 = (???ni=1(si - m)2)/n

?????£?????£????????????????¨???????????±??¨?????????
"""
import math
while True:
    num = int(input().strip())
    if num == 0:
        break
    s = list(map(float,input().strip().split()))
    
    # ?????????
    m = 0
    for i in range(num):
        m += s[i]
    m = m / num
    
    # ?¨??????????
    a2 = 0
    for i in range(num):
        a2 += (s[i] - m) ** 2
    a = math.sqrt(a2 / num)
    print(a)

Submission status: Accepted

Solution code:
import statistics

while True:
	n = int(input())
	if n == 0:
		break
	else:
		data = [float(s) for s in input().split()]
		print(statistics.pstdev(data))

Submission status: Accepted

Solution code:
import math

while True:
	n = eval(input())
	if n == 0:
		break
	s = [eval(x) for x in input().split()]
	m = sum(s)/n
	sd = math.sqrt(sum([(x-m)**2 for x in s])/n)
	print(sd)

Submission status: Accepted

Solution code:
import statistics

def main():
    while True:
        try:
            N = int(input())
            S = tuple(map(int, input().split()))
            print(statistics.pstdev(S))
        except EOFError:
            break

main()

Submission status: Accepted

Solution code:
import statistics

while True:
    n=int(input())
    if n==0:
        break
    
    stdnt=list(map(int,input().split()))
    
    std=statistics.pstdev(stdnt)
    
    print(std)

Submission status: Accepted

Solution code:
import statistics
while True:
    x = int(input())
    if x == 0:
        break
    else:
        ls = list(map(int, input().split()))
        print("{0:.8f}".format(statistics.pstdev(ls)))

Submission status: Accepted

Solution code:
import statistics

while True:
  s=int(input())
  if s==0:
    break
  else:
   lst=list(map(int,input().split()))
  print("{0:.8}".format(statistics.pstdev(lst)))

Submission status: Accepted

Solution code:
from statistics import pstdev

while True:
    if input() == '0': break
    v_list = (int(x) for x in input().split())
    print(pstdev(v_list))

Submission status: Accepted

Solution code:
import statistics

while True:
	n = int(input())
	if n == 0:
		break
	
	str = input().split()

	list = []
	for i in range(n):
		list.append(int(str[i]))

	print(statistics.pstdev(list))

Submission status: Accepted

Solution code:
import statistics as stats

while True:
    n = int(input())
    if n == 0:
        break
    data = list(map(int, input().split()))
    SD = stats.pstdev(data)
    print("{:.5f}".format(SD))

Submission status: Accepted

Solution code:
while True:
    a=int(input())
    if a==0 :
        break
    b=list(map(float,input().split()))
    m=sum(b)/a
    ver=0.0
    for i in b :
        ver+=(i-m)**2/a
        s=(ver)**0.5

    print(s)

Submission status: Accepted

Solution code:
import math
while True:
    n=int(input())
    if n == 0: break
    x=list(map(int,input().split()))
    ave=sum(x)/n
    a=0
    for i in x:
        a += (i-ave)**2 / n
    print(math.sqrt(a))

Submission status: Accepted

Solution code:
# Aizu Problem ITP_1_10_C: Standard Deviation
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


while True:
    n = int(input())
    if n == 0:
        break
    A = [int(_) for _ in input().split()]
    mean = sum(A) / n
    sd = math.sqrt(sum([(a - mean)**2 for a in A]) / n)
    print("%.8f" % sd)

Submission status: Accepted

Solution code:
import math
 
ans = []
 
while True:
    if int(input()) == 0:
        break
    data = list(map(int, input().strip().split()))
    ave_data = sum(data) / len(data)
    ans += [math.sqrt(sum([(i - ave_data) ** 2 for i in data]) / len(data))]
     
print('\n'.join(map(str, ans)))

Submission status: Accepted

Solution code:
import math
member = []
score = []
while True:
    num = int(raw_input())
    if num == 0: break
    member.append(num)
    score.append(map(int, raw_input().split()))

alpha = []
for m, s in zip(member, score):
    average = sum(s)/float(m)
    sigma = 0
    for t in s:
        sigma += (t - average)**2
    else:
        alpha += [sigma/m]

for a in alpha:
    #print '%.8f' % math.sqrt(a)
    print math.sqrt(a)

Submission status: Accepted

Solution code:
import math
member = []
score = []
while True:
    num = int(raw_input())
    if num == 0: break
    member.append(num)
    score.append(map(int, raw_input().split()))

alpha = []
for m, s in zip(member, score):
    average = sum(s)/float(m)
    sigma = 0
    for t in s:
        sigma += (t - average)**2
    else:
        alpha += [sigma/m]

for a in alpha:
    print math.sqrt(a)

Submission status: Accepted

Solution code:
import statistics
while True:
    n = int(input())
    if n == 0:
        break
    s = [int(p) for p in input().split()]
    print(statistics.pstdev(s))

Submission status: Accepted

Solution code:
import statistics
while 1:
    n = int(input())
    if n == 0:
        break
    else:
        data = list(map(int, input().split()))
        print(statistics.pstdev(data))

Submission status: Accepted

Solution code:
import math
while True:
    num = int(input())
    if num == 0: break
    array = [int(i) for i in input().split()]
    mean = sum(array) / num
    a = 0
    for i in range(num):
        a += (array[i] - mean) ** 2
    a /= num
    a = math.sqrt(a)
    print(a)

Submission status: Accepted

Solution code:
from math import sqrt
from statistics import mean

while True:
    s = input()
    if s == "0":
        break

    l = list(map(int, input().split()))
    length = len(l)
    m = mean(l)
    print("{:.8f}".format(sqrt(sum(map(lambda i: (i-m) ** 2, l)) / length)))

Submission status: Accepted

Solution code:
while True:
    n = int( input() )
    if n==0:
        break
    a=list(map(int, input().split()))
    m=sum(a)/n
    s=0
    for i in a:
        s+=(i-m)**2
    print( ( s/n)**0.5 )

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(float, input().split()))
    m = sum(s) / n

    v = sum([(x - m) ** 2 for x in s]) / n
    print(v ** 0.5)

Submission status: Accepted

Solution code:
import math
for d in iter(input, '0'):
    n, s = int(d), list(map(int, input().split()))
    print(math.sqrt(sum([si**2 for si in s])/n - (sum(s)/n)**2))

Submission status: Accepted

Solution code:
import math

while(True):
	n = int(input())
	if n==0:
		break;
	list_str = input().split(' ')
	list_int = []
	sum = 0
	for value in list_str:
		newVar = float(value)
		sum += newVar
		list_int.append(newVar)
	sum /= n
	
	result = 0
	for value in list_int:
		result += (value - sum) * (value - sum)
		
	result = math.sqrt(result / n) if result != 0 else 0
	
	
	print('%.8f'%result)

Submission status: Accepted

Solution code:
while True:
	n = int(raw_input())
	if n == 0:
		break
	else:
		data = map(int, raw_input().split())

		all_sum = 0
		for i in range(n):
			all_sum += data[i]
		ave = all_sum * 1.0 / n

		bunsan_sum = 0
		for i in range(n):
			bunsan_sum += (data[i] - ave)**2
		bunsan = bunsan_sum / n

		alpha = bunsan ** 0.5

		print("{:.8f}".format(alpha))

Submission status: Accepted

Solution code:
import sys
import math
def main():
    for line in sys.stdin:
        n = int(line)
        if n == 0:
            break
        else:
            A = list(map(float, input().split()))
            t1 = 0
            for a in A:
                t1 += a
            ave = t1 / len(A)
            
            t2 = 0
            for a in A:
                t2 += (a - ave) ** 2
            s = math.sqrt(t2 / n)
            print(s)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from __future__ import division
import math

while True:
    n = int(raw_input())
    if n == 0:
        break
    data = map(float, raw_input().split())
    m = sum(data) / n
    var = sum([(i-m)**2 for i in data]) / n
    std = math.sqrt(var)
    print "{:.5f}".format(std)

Submission status: Accepted

Solution code:
while input()!='0':
    l=list(map(float,input().split()))
    m=sum(l)/len(l)
    s=0
    for i in range(len(l)):
        s+=(l[i]-m)**2
    print('%.8f'%((s/len(l))**.5))

Submission status: Accepted

Solution code:
import statistics

while True:
    n = int(input())
    if n == 0:
        break

    s = map(float, input().split())
    print(statistics.pstdev(s))

Submission status: Accepted

Solution code:
import math

while True:
    line = int(input())
    if line == 0:
        break
    l = [float(s) for s in input().split()]
    avg = sum(l) / len(l)
    a2 = 0
    for i in l:
        a2 += (avg - i) ** 2

    print(math.sqrt(a2 / len(l)))

Submission status: Accepted

Solution code:
while True:
    result=0
    SS=0
    n=int(input())
    if n==0:
        break
    s=list(map(int,input().split()))
    average=(sum(s)/n)
    for i in s:
        SS=((average-i)**2)/n
        result+=SS
    print(result**(1/2))

Submission status: Accepted

Solution code:
while 1:
    r=0
    S=0
    n=int(input())
    if n==0:break
    s=list(map(int,input().split()))
    a=(sum(s)/n)
    for i in s:
        S=((a-i)**2)/n
        r+=S
    print(r**0.5)

Submission status: Accepted

Solution code:
while 1:
    r=0
    S=0
    n=int(input())
    if n==0:break
    s=list(map(int,input().split()))
    print(sum([((sum(s)/n)-i)**2/n for i in s])**0.5)

Submission status: Accepted

Solution code:
# -*-coding:utf-8

import math

def main():

    while True:
        scoreNumber = int(input())
        if(scoreNumber == 0):
            break

        scoreList = list(map(float, input().split()))
        scoreAve = sum(scoreList) / len(scoreList)

        scoreSum = 0
        for i in scoreList:
            scoreSum += pow(i-scoreAve, 2) / len(scoreList)

        print(math.sqrt(scoreSum))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import sqrt
while True:
      n = int(input())
      if n == 0:
          break
      else:
          scores = list(map(int, input().split()))
          ave = float(sum(scores)) / n
          numerator = 0
          for s in scores:
              numerator += (s - ave)**2
          alpha = numerator / n
          print(sqrt(alpha))

Submission status: Accepted

Solution code:
import math


def main():
    while True:
        n = int(input())
        if n == 0:
            break

        nums = list(map(int, input().split()))
        mean = sum(nums) / n
        var = sum((s - mean) ** 2 for s in nums) / n
        sd = math.sqrt(var)

        print(sd)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
while 1:
 n=int(input())
 if n==0:break
 s=list(map(int,input().split()))
 print((sum([(m-sum(s)/n)**2 for m in s])/n)**.5)

Submission status: Accepted

Solution code:
while 1:
 n=int(input())
 if n==0:break
 s=[int(x) for x in input().split()]
 print((sum([(m-sum(s)/n)**2 for m in s])/n)**.5)

Submission status: Accepted

Solution code:
while 1:
 n=int(input())
 if n==0:break
 s=input().split()
 a=sum([int(x) for x in s])/n
 print((sum([int(x)**2 for x in s])/n-a*a)**.5)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    m = sum(s) / n
    z = sum([(float(s[i])-m)**2 for i in range(n)])
    b = z / n
    print("{0:.8f}".format(math.sqrt(b)))

Submission status: Accepted

Solution code:
while True:
    n = int(input())

    if n == 0:
        break

    si = list(map(int, input().split()))
    m = sum(si) / n
    func = (lambda x: (x - m) ** 2)
    print((sum(map(func, si)) / n) ** .5)

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n == 0:
        break

    arr = list(map(int, input().split()))
    m = sum(arr) / n
    t = 0
    for i in range(n):
        t += math.pow(arr[i] - m, 2)
    a = math.sqrt(t/n)
    print("{0:5f}".format(a))

Submission status: Accepted

Solution code:
from math import *
while True:
    n = int(input())
    if n == 0:
        break
    s = list(map(int, input().split()))
    sum_s = sum(s)
    m = sum_s / n
    print(sqrt(sum((a - m) ** 2 for a in s) / n))

Submission status: Accepted

Solution code:
from statistics import pstdev
while True:
    data_count = int(input())
    if data_count == 0:
        break
    print(pstdev(int(x) for x in input().split()))

Submission status: Accepted

Solution code:
from statistics import pstdev
while True:
    data_count = int(input())
    if data_count == 0:
        break
    print(pstdev(map(int, input().split())))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    data = input().split()
    import math
    sum = 0
    for i in range(n):
        sum = sum + int(data[i])
    average = sum / n
    a = 0
    for i in range(n):
        a = a + (int(data[i]) - average)**2
    print('{}'.format(math.sqrt(a/n)))

Submission status: Accepted

Solution code:
import math
i = 0
k = 0
q = 0
while k == 0 :
    N = int(input())
    if N == 0 :
        k = k + 1
    else :
        S = list(map(float, input().split()))        
        while k ==0 and i < N :
            m = sum(S) / N
            q = q + ((S[i] - m)**2)
            i = i + 1
        print(math.sqrt(q / N))
        q = 0
        i = 0

Submission status: Accepted

Solution code:
while 1:
 n=int(input())
 if n==0:break
 s=list(map(int,input().split()))
 a=sum(s)/n
 print((sum([x*x for x in s])/n-a*a)**.5)

Submission status: Accepted

Solution code:
while input()!='0':
 s=list(map(int,input().split()))
 n=len(s)
 a=sum(s)/n
 print((sum([x*x for x in s])/n-a*a)**.5)

Submission status: Accepted

Solution code:
while int(input()):
 s=list(map(int,input().split()))
 n=len(s)
 a=sum(s)/n
 print((sum([x*x for x in s])/n-a*a)**.5)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(float, input().split()))
    m = sum(s) / n

    a_2 = sum([(x - m) ** 2 for x in s]) / n
    print(a_2 ** 0.5)

Submission status: Accepted

Solution code:
import statistics
while True:
    num = input()
    if num == '0':
        break
    value = map(int, input().split())
    print(statistics.pstdev(value))

Submission status: Accepted

Solution code:
# coding:utf-8
import math
while True:
    n = input()
    if n == 0:
        break
    t = [0.0 for i in range(n)]
    a2 = 0.0
    array = map(float,raw_input().split())
    average = sum(array) / n
    for i in range(n):
        t[i] = math.pow(array[i]-average,2)
    a2 = sum(t) / n
    a = math.sqrt(a2)
    print a

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n==0:
        break
    score = list(map(int, input().split()))
    ave = sum(score) / n
    print((sum([(i-ave)**2 for i in score])/n)**0.5)

Submission status: Accepted

Solution code:
while True:
    num = int(input())
    if num == 0:
        break
    data = list(map(int, input().split()))
    datasqr = [i ** 2 for i in data]
    print("%lf" % (sum(datasqr) / num - (sum(data) / num) ** 2) ** 0.5)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    scores = [int(x) for x in input().split()]
    ave = sum(scores)/n
    resi = 0
    for s in scores:
        resi += (s-ave)**2
    sd = (resi/n)**0.5
    print('{:.6f}'.format(sd))

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

while True:
    n = int(sys.stdin.readline())
    if n == 0:
        break

    score = list(map(int, sys.stdin.readline().split()))
    ave = sum(score) / len(score)

    s2 = 0
    for v in score:
        s2 += (v-ave) ** 2
    print(round((s2 / len(score)) ** 0.5, 6))

Submission status: Accepted

Solution code:
while input()!='0':
    n=list(map(int,input().split()))
    b=len(n)
    a=sum(n)/b
    print((sum((x-a)**2 for x in n)/b)**0.5)

Submission status: Accepted

Solution code:
from math import sqrt
from statistics import mean

def standard_deviate(numbers):
    m = mean(numbers)
    b = sum([(n - m)**2 for n in numbers])
    return sqrt(b/len(numbers))

if __name__ == '__main__':
    while True:
        n = int(input())
        if n == 0:
            break
        students = list(map(int, input().split()))[0:n]
        print(standard_deviate(students))

Submission status: Accepted

Solution code:
from math import sqrt

def standard_deviate(numbers):
    m = sum(numbers) / len(numbers)
    d = sqrt(sum([(n - m)**2 for n in numbers]) / len(numbers))
    return d

if __name__ == '__main__':
    while input() != '0':
        students = list(map(int, input().split()))
        print(standard_deviate(students))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    m = list(map(int, input().split()))
    mean = sum(m) / len(m)
    std = (sum([(i - mean) ** 2 for i in m]) / len(m)) ** 0.5
    print("{:4f}".format(std))

Submission status: Accepted

Solution code:
while int(input()) != 0:
    m = list(map(int, input().split()))
    mean = sum(m) / len(m)
    std = (sum([(i - mean) ** 2 for i in m]) / len(m)) ** 0.5
    print("{:4f}".format(std))

Submission status: Accepted

Solution code:
import math
while(True):
    if input() == '0':
        break
    a = list(map(int, input().split()))
    m = sum(a) / len(a)
    b = 0
    for i in a:
        b += (i - m) ** 2.0
    stddev = math.sqrt(b / len(a))
    print(stddev)

Submission status: Accepted

Solution code:
ans = ''
while True:
    n = int(input())
    if n == 0:
        break
    else:
        L = list(map(float, input().split(' ')))
        ave = 0
        for i in L:
            ave += i
        ave /= n
        sigma = 0
        for i in L:
            sigma += pow(i - ave, 2)
        sigma /= n
        sigma = pow(sigma, 0.5)
        ans += '{0:.8f}'.format(sigma) + '\n'
print(ans[:-1])

Submission status: Accepted

Solution code:
import statistics


def stddev(values):
    """ calculate standard deviation

    >>> s = stddev([70, 80, 100, 90, 20])
    >>> print('{:.5f}'.format(s))
    27.85678
    >>> s = stddev([80, 80, 80])
    >>> print('{:.5f}'.format(s))
    0.00000
    """
    return statistics.pstdev(values)


def run():
    while True:
        c = int(input())  # flake8: noqa
        if c == 0:
            break
        values = [int(i) for i in input().split()]
        print(stddev(values))


if __name__ == '__main__':
    run()

Submission status: Accepted

Solution code:
from math import sqrt

while True:
    n = int(input().strip())    
    if n == 0:
        break    
    scores = list(map(float, input().strip().split()))
    sum1 = 0 
    for i in scores:
        sum1 += i
    heikin = sum1 * 1 / n
    sum2 = 0
    for i in scores:
        sum2 += (i - heikin) ** 2
    a = sqrt(sum2 / n)
    print(a)

Submission status: Accepted

Solution code:
#coding: utf-8
import math

while True:
    n = int(input())
    if n == 0:
        break
    s = [float(i) for i in input().split(" ")]
    m = 0

    for i in s:
        m += i
    m /= n

    a2 = 0
    for i in s:
        a2 += (i-m)**2/n

    print(math.sqrt(a2))

Submission status: Accepted

Solution code:
from statistics import mean
import math
ans = []
while 1:
  n = int(input())
  if n == 0: break
  l = list(map(int, input().split()))
  m = mean(l)
  print("{0:.8f}".format(math.sqrt(sum([(s - m) ** 2 for s in l]) / n)))

Submission status: Accepted

Solution code:
while input() != "0":
  l = list(map(int, input().split()))
  print("{0:.8f}".format((sum([(s - sum(l) / len(l)) ** 2 for s in l]) / len(l)) ** 0.5))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    else:
        score = [int(x) for x in input().split()]
        a = 0
        m = sum(score)/n
    for s in score:
        a += (s-m)**2
    a = (a/n)**0.5
    print('{:.8f}'.format(a))

Submission status: Accepted

Solution code:
std_value = []
while True:
    n = int(input())
    if n == 0:
        break
    s = [int(i) for i in input().split()]#生徒の点数
    sum_value=0
    s_ave = 0
    for i in range(len(s)):#平均値計算
        sum_value += s[i]
    ave = sum_value/len(s)
    for j in range(len(s)):
        s_ave += (s[j]-ave)**2
    std_value.append((s_ave/len(s))**(1/2))
for k in range(len(std_value)):
    print("{:.8f}".format(std_value[k]))

Submission status: Accepted

Solution code:
import math

while True:
    s = int(input())
    if s == 0:
        break

    r = list(map(float, input().split()))
    x = sum(r) / s
    sigtwo = sum(list(map(lambda y: (y-x)**2, r))) / s
    sig = math.sqrt(sigtwo)
    print("{:.8f}".format(sig))

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    s = [int(x) for x in input().split()]
    a = math.sqrt(sum([(i - sum(s)/n)**2 for i in s])/n)
    print("{:.8f}".format(a))

Submission status: Accepted

Solution code:
import math
sigma=[]
while(True):
    N=int(input())
    if N==0:
        break
    s=[int(i) for i in input().split()]
    av=sum(s)/N
    sg=math.sqrt(sum([(s[i]-av)**2 for i in range(N)])/N)
    sigma.append(sg)
for sg in sigma:
    print(sg)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0: break
    s = list(map(int, input().split()))
    ave = sum(s) / n
    S = []
    for i in range(n):
        key = ave - s[i]
        S.append(key * key)
    print('{:.5f}'.format(math.sqrt(sum(S) / n)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import math

while True:
    n = int(input())

    if n == 0:
        break

    s = list(map(float, input().split()))
    mean = sum(s) / len(s)

    for i in range(len(s)):
        s[i] = (s[i] - mean) * (s[i] - mean)

    variance = sum(s) / len(s)
    stdev = math.sqrt(variance)

    print(stdev)

Submission status: Accepted

Solution code:
#! python3
# standard_deviation.py

import math

while True:
    n = int(input())
    if n == 0: break
    s = [int(x) for x in input().split(' ')]

    sum = 0
    for num in s:
        sum += num
    m = sum/n

    tmp_sum = 0
    for num in s:
        tmp_sum += pow(num - m, 2)

    print("%.5f"%(math.sqrt(tmp_sum/n)))

Submission status: Accepted

Solution code:
import math
while 1:
    N = int(input())
    if N == 0:
        break
    xs = list(map(int, input().split()))
    avg = 0
    for x in xs:
        avg += x
    avg /= len(xs)
    var = 0
    for x in xs:
        var += (x - avg) ** 2
    var /= len(xs)
    print(math.sqrt(var))

Submission status: Accepted

Solution code:
while int(input()):
 s=list(map(int,input().split()))
 n=len(s)
 a=sum(s)/n
 print((sum(x*x for x in s)/n-a*a)**.5)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    m = sum(s) / n
    v = 0
    for si in s:
        v += (si - m) ** 2
    ans = (v / n) ** 0.5
    print("{:.5f}".format(ans))

Submission status: Accepted

Solution code:
import math
n=int(input())
while n != 0 :
	sums = 0.0
	s = list(map(float,input().split()))
	m = sum(s)/n
	for i in range(n):
		sums += ((s[i]-m)**2)/n
	print(math.sqrt(sums))
	n = int(input())

Submission status: Accepted

Solution code:
import math

A=[]
while True:
    n=int(input())
    if n==0:
        break
    s=input().split()
    #m=(s1+s2+...sn)/n
    #H=(s1-m)^2/n+(s2-m)^2/n+...(sn-m)^2/n
    #h=math.sqrt(H)
    i=0
    su=0
    while i<n:
        su+=int(s[i])
        i+=1
    m=su/n

    l=0
    H=0
    while l<n:
        H+=(int(s[l])-m)*(int(s[l])-m)/n
        l+=1
    h=math.sqrt(H)
    A.append(h)

for Ans in A:
    print(Ans)

Submission status: Accepted

Solution code:
import math

while True:
    n = float(input())
    aan = 0
    if n == 0:
        break
    scores = list(map(float, input().split()))
    total = sum(scores)
    avg = total / len(scores)
    for score in scores:
        aan += (score - avg)**2
    aa = aan / len(scores)
    a = math.sqrt(aa)
    print(a)