Problem:
Standard Deviation You have final scores of an examination for n students. Calculate standard deviation of the scores s 1 , s 2 ... s n . The variance α 2 is defined by α 2 = (∑ n i =1 (s i - m) 2 )/n where m is an average of s i .

  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  s 1  s 2 ... s n  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 ≤ s i ≤ 100  Sample Input 5
70 80 100 90 20
3
80 80 80
0 Sample Output 27.85677655
0.00000000

Solution (Python):
import math

"???????????° n"
"s1 s2 ... sn"

while True:
    num_students = int(input().rstrip())
    if num_students == 0:
        break
    
    score = list(map(int,input().split(" ")))
    
    
    score_total = 0
    score_average = 0
    for tmp_score in score:
        score_total = score_total + tmp_score
    
    score_average = score_total / len(score)

    
    tmp_dev = 0
    sta_dev = 0
    for tmp_score in score:
        tmp_dev = tmp_dev + (tmp_score - score_average) ** 2
    
    sta_dev = math.sqrt(tmp_dev/num_students)

    print("{:.5f}".format(sta_dev))

Solution (Python):
from statistics import pstdev

while True:
    n = input()
    if n == '0':
        break
    print(pstdev(map(int, input().split())))

Solution (Python):
from statistics import pstdev

while input() != '0':
    print(pstdev(map(int, input().split())))

Solution (Python):
from statistics import pstdev

while input() != '0':
    print(pstdev(map(int, input().split())))

Solution (Python):
import math
while True:
    n = int(input())
    if n == 0:
        break
    inp = list(map(float,input().split()))
    m = sum(inp)/len(inp)
    stdev = math.sqrt(sum([(s-m)**2 for s in inp])/len(inp))
    print(stdev)

Solution (Python):
import math
while True:
	a_2 = 0
	n = int(input())
	if n == 0:
		break
	
	score = [int(x) for x in input().split()]
	m = sum(score)/len(score)
	

	for i in range(len(score)):
		a_2 += (score[i]-m)*(score[i]-m)/n
		
	print('%.4f'% math.sqrt(a_2))

Solution (Python):
import math

while True:
    n = int(input())
    if n == 0 :
        break
    nums = [int(x) for x in input().split(" ")]
    mean = sum(nums) / n

    variance = sum([(x - mean) ** 2 for x in nums]) / n
    std = math.sqrt(variance)
    print(std)

Solution (Python):
import statistics
while 1:
    n = input()
    if n == "0":
        break
    a = [int(i) for i in input().split()]
    print(statistics.pstdev(a))

Solution (Python):


import statistics
import sys


def main():
    while True:
        n = int(sys.stdin.readline())
        if n == 0:
            sys.exit(0)
        print(statistics.pstdev([int(num) for num
                                in sys.stdin.readline().split()]))


if __name__ == '__main__':
    main()

Solution (Python):
import math

while True:
    temp = []
    n = int(input())
    if n == 0:
        break
    point = list(map(int, input().split()))
    m = sum(point)/len(point)
    for i in point:
        temp.append((i - m)**2)
    print('{0:.8f}'.format(math.sqrt(sum(temp)/n)))

Solution (Python):
import math
while 1:
	n=input()
	if n==0:break
	l=map(int,raw_input().split())
	sum=0
	for i in l:sum+=i
	a=float(sum)/n
	sum2=.0
	for i in l:sum2+=(i-a)**2
	print math.sqrt(sum2/n)

Solution (Python):
while True:
    n = int(input())
    if n==0:
        break
    s = list(map(float, input().split()))
    m = sum(s) / n
    var = sum([(s[i] - m)**2 for i in range(n)]) / n
    print("{:.5f}".format(var**0.5))

Solution (Python):
while True:
    if input()=="0":
        break
    data = list(map(float,input().split()))
    ave = sum(data)/len(data)
    std_div = (sum([(ave-i)**2 for i in data]) /len(data))**(1/2)
    print(std_div)

Solution (Python):


import sys
import os
import math


while True:
    N = int(input())
    if N == 0:
        break
    scores = list(map(float, input().split()))
    n = len(scores)
    mean = sum(scores) / n

    variance = 0
    for score in scores:
        variance += (score - mean) ** 2
    variance /= n

    print(math.sqrt(variance))

Solution (Python):
from statistics import pstdev

scores = []
while True:
    n = int(input())
    if n == 0:
        break
    l = list(map(int, input().split()))
    scores.append(l)

for score in scores:
    print(pstdev(score))

Solution (Python):
import statistics as st

while(1):
    n = int(input())
    if n == 0:
        break
    s = list(map(int, input().split()))
    print(st.pstdev(s))

Solution (Python):


import sys
import collections

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))


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):
        
        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")
        

if __name__ == "__main__" :

    calculate_standard_deviation()

Solution (Python):
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))

Solution (Python):
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)))

Solution (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)))

Solution (Python):

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)

Solution (Python):
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))

Solution (Python):
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())

Solution (Python):
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())

Solution (Python):
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())

Solution (Python):
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)

Solution (Python):
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)))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
import statistics

while True:
    n = int(input())

    if n == 0:
        break

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

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):


"""
?¨??????????

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)

Solution (Python):
import statistics

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

Solution (Python):
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)

Solution (Python):
import statistics

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

main()

Solution (Python):
import statistics

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

Solution (Python):
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)))

Solution (Python):
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)))

Solution (Python):
from statistics import pstdev

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

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):


import sys, math, os


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)

Solution (Python):
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)))

Solution (Python):
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)

Solution (Python):
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)

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

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

Solution (Python):
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)

Solution (Python):
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)))

Solution (Python):
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 )

Solution (Python):
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 )

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
import statistics

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

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

Solution (Python):
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)))

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):


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()

Solution (Python):
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))

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)))

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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))

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

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

Solution (Python):
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)))

Solution (Python):
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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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

Solution (Python):

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):



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))

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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])

Solution (Python):
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())  
        if c == 0:
            break
        values = [int(i) for i in input().split()]
        print(stddev(values))


if __name__ == '__main__':
    run()

Solution (Python):
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)

Solution (Python):

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))

Solution (Python):
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)))

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
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]))

Solution (Python):
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))

Solution (Python):
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))