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:
import math
while 1:
    n=int(input())
    avg=0
    bun=0
    a=[0 for i in range(n)]
    if n==0:
        break
    s=list(map(int, input().split()))
    for i in range(n):
        avg+=s[i]
    avg=avg/n
    for i in range(n):
        a[i]+=(s[i]-avg)**2
    for i in range(n):
        bun+=a[i]
    bun=bun/n
    ans=math.sqrt(bun)
    print(ans)

Submission status: Accepted

Solution code:
#2020-03-21
import math
while True:
    n = int(input())
    if n == 0:
        break
    s = list(map(int, input().split()))
    
    ave = sum(s) / n
    dev = math.sqrt(sum((ave - si) ** 2 for si in s) / n)

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

Submission status: Accepted

Solution code:
import math

while True:
    N = int(input())
    if N == 0:
        break
    point = list(map(int,input().split())) 
    sum = 0
    for i in range(N):
        sum += point[i]

    heikin = sum / N
    s = 0
    for i in range(N):
        s += (point[i]-heikin)**2

    a2 = s / N
    a =math.sqrt(a2)

    print(round(a,8))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0: break
    S = list(map(int, input().split()))
    mean = sum(S)/n
    V = []
    for s in S:
        V.append((s-mean)**2)
    std = (sum(V)/n)**(1/2)
    print(std)

Submission status: Accepted

Solution code:

while True:
    N = int(input())
    if N == 0:
        break
    A = list(map(int, input().split()))
    avg = sum(A)/N
    sig = sum([(a-avg)**2 for a in A])
    print((sig/N)**0.5)

Submission status: Accepted

Solution code:
import math

students = []
data = []
ans = []
while True:
  n = int(input())
  if n == 0:
    break
  students.append(n)
  data.append(list(map(int,input().split())))
for student, result in zip(students, data):
  total = 0
  for i in result:
    total += i
  average = total / student
  S = 0
  for j in result:
    S += (j - average) ** 2
  dispersion = S / student
  ans.append(math.sqrt(dispersion))
for out in ans:
  print(out)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while 1:
    n = int(input())
    s = 0
    t = 0
    if n == 0:
        break
    a = list(map(float,input().split()))
    s += sum(a)
    h = float(sum(a)/int(n))
    for i in range(n):
        t += float(((a[i] - h)**2)/float(n))
    st = t**0.5
    print(st)

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
    x = 0
    for i in range(n):
        x += (s[i] - m) ** 2
    print("{:f}".format(math.sqrt(x / n)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
while True:
    num=int(input())
    if num==0:
        break
    lst=list(map(int,input().split()))
    m=sum(lst)/len(lst)
    var=[(i-m)**2 for i in lst]
    n_var=sum(var)/len(lst)
    print(round(math.sqrt(n_var),8))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
while n != 0:
    s = list(map(float, input().split()))
    ave = sum(s) / n
    aa = 0.0
    for i in range(n):
        aa += (s[i] - ave)**2
    aa = math.sqrt(aa / n)
    print("{:10f}".format(aa))
    n = int(input())

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        exit()
    s = list(map(int,input().split()))
    m = sum(s) / n
    aa = 0
    for si in s:
        aa += (si - m) ** 2
    print(format((aa / n)**0.5,"0.5f"))

Submission status: Accepted

Solution code:
import math
from statistics import mean

while True:

    n = int(input())

    if n == 0:
        break
    
    scores = [float(x) for x in input().split()]
    m = mean(scores)
    
    a = 0
    a2 = 0
    for i in range(len(scores)):
        a2 += (scores[i] - m) ** 2 / len(scores)
    
    a = math.sqrt(a2)
    
    print(a)

Submission status: Accepted

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

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) / len(s)

    num = 0.0
    for i in range(n):
        num += (s[i] - m) ** 2
    variance = num / n
    deviation = math.sqrt(variance)
    print(deviation)

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n == 0:
        break;
    s = list(map(int, input().split()))
    sum = 0

    for i in range(n):
        sum += s[i]
    average = sum / n

    sum = 0
    for i in range(n):
        sum += (s[i] - average) ** 2
    print('{:.10f}'.format(math.sqrt(sum / n)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = list()
while 1 :
	n = int(input())
	if n == 0: break
	s = list(map(int, input().split()))
	avg = sum(s)/n
	tmp = 0
	for i in s: tmp += (i-avg)**2
	ans += [(tmp/n)**(1/2)]

for i in ans: print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import itertools
import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

while 1:
    N = int(readline())
    if N == 0:
        break
    A = [int(x) for x in readline().split()]
    m = sum(A)/N
    ans = 0
    for i in A:
        ans += (i - m) ** 2
    print((ans/N)**.5)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    values = list(map(lambda x: float(x), input().split()))
    mean = sum(values) / len(values)
    print(math.sqrt(sum(list(map(lambda x: (x - mean) ** 2, values))) / len(values)))

Submission status: Accepted

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

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

    sum_s = sum(s)
    avg_s = (float)(sum_s / n)
    div = 0
    for v in s:
        div += (v - avg_s) ** 2 / n
    print("{:.10f}".format(div ** 0.5))

Submission status: Accepted

Solution code:
import math
while True :
    n = int(input())
    if n == 0 :
        break
    data = list(map(int, input().split()))
    mean = sum(data) / n
    variance = 0
    stdev = 0
    for d in data :
        variance += (d - mean) ** 2
    variance = variance / n
    stdev = math.sqrt(variance)
    print(stdev)

Submission status: Accepted

Solution code:
import sys
import math
import decimal

args = []
for l in sys.stdin:
    args.append(l)
lines = []
cnt = 0

while cnt < int(len(args)) - 1:
    num = int(args[cnt])
    cnt += 1
    if(num == 0):
        continue
    data = args[cnt].split(' ')
    cnt += 1

    numLine = []
    for points in data:
        numLine.append(int(points))

    average = 0.0
    for points in numLine:
        average += int(points)
    average /= num
    
    distributed = []
    for points in numLine:
        distributed.append((points - average) * (points - average))
    
    std_dev = 0.0
    for value in distributed:
        std_dev += value
    
    lines.append(math.sqrt(std_dev / num))

for line in lines:
    result = decimal.Decimal(line).quantize(decimal.Decimal("0.00000000"))
    if(decimal.Decimal(0E-8) == result):
        print("0.00000000")
    else:
        print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n == 0:
        break
    score = list(map(int, input().split()))
    ave = 0
    sum = 0
    for i in range(n):
        ave += score[i]
        sum += score[i]**2
    ave /= n
    sum = (sum - n*ave**2) / n
    print("%f" %(math.sqrt(sum)))

Submission status: Accepted

Solution code:
import math
ans = []
while True:
    n = int(input())
    if n == 0:
        break
    sn = list(map(float,input().split()))
    avg = sum(sn) / len(sn)
    var = 0
    for i in sn:
        var += (i - avg)**2
    var /= n
    ans.append(math.sqrt(var))

for i in ans:
    print(i)

Submission status: Accepted

Solution code:
while True:
    n=input()
    if n==0:
        break
    s=map(float,raw_input().split())
    m=sum(s)/len(s)
    bunsan=0
    for i in range(n):
        bunsan+=(s[i]-m)**2
    bunsan=bunsan/n
    hensa=bunsan**(0.5)
    print hensa

Submission status: Accepted

Solution code:
# coding: utf-8
import math

while True:
    n = int(input())

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

    total = 0
    
    for i in s:
        total += i

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

    print((d / n) ** (1 / 2))

Submission status: Accepted

Solution code:
import statistics,math

while True:
    N = int(input())
    if N == 0:
        break
    s = list(map(int,input().split()))
    
    pstdev = statistics.pstdev(s)
    print(pstdev)

Submission status: Accepted

Solution code:
n = int(input())

while n != 0:
    *s, = map(int, input().split())
    m = sum(s)/n
    a = 0
    for i in range(n):
        a += ((s[i]-m)**2)/n

    print("{:.8f}".format(a**0.5))
    n = int(input())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import  math
while(True):
    n=int(input())
    if n==0:
        exit()
    s=list(map(int,input().split()))

    ave=sum(s)/n
    v=0
    for i in range(n):
       v+=(s[i]-ave)**2

    v/=n
    print(math.sqrt(v))

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n==0: break
    
    a = list(map(int, input().split()))
    
    mean = sum(a)/len(a)
    
    v = 0
    for i in a:
        v += (i - mean)**2
    
    v /= len(a)
    sd = math.sqrt(v)
    
    print('%.5f'%sd)

Submission status: Accepted

Solution code:
import math

def ave(A,n):
    sum=0
    for i in range(n):
        sum+=A[i]
    return (sum/n)

def stdev(A,ave,n):
    sum=0
    for i in range(n):
        sum+=(A[i]-ave)**2
    return ((sum/n)**0.5)

n=int(input())
while n!=0:
    A=list(map(float,input().split()))
    Ave=ave(A,n)
    print(stdev(A,Ave,n))
    n=int(input())

Submission status: Accepted

Solution code:
import statistics

answer = []

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

    s = list(map(int, input().split()))
    answer.append(statistics.pstdev(s))

[print("{:.8f}".format(answer[i])) for i in range(len(answer))]

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
 S2 = S
 for si in range(n):
  S2[si] = (S[si]-m)**2
 SS = sum(S2)/n
 sd = math.sqrt(SS)
 print(sd)

Submission status: Accepted

Solution code:

import statistics

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

Submission status: Accepted

Solution code:
import statistics as st
olist = []
while True:
    n = int(input())
    if n == 0:
        break
    lst = []
    lst = input().split()
    if n == 1:
        olist.append(0)
    else:
        lst = [int(s) for s in lst]
        olist.append(st.pstdev(lst))
for s in olist:
    print("{:.8f}".format(s))

Submission status: Accepted

Solution code:
while True:
  n = int(input())
  if n == 0: break
  s = [int(i) for i in input().split()]
  ave = sum(s) / n
  sd = (sum([(i - ave) ** 2 for i in s]) / n) ** (1 / 2)
  print(sd)

Submission status: Accepted

Solution code:
#初期値の入力
import math
standard_deviation = list()

while True:
    student_number = int(input())
    if student_number == 0:
        break
    score_data = list(map(float, input().split()))
    #平均値計算
    score_ave = sum(score_data) / len(score_data)
    score_dispersion = float()
    for data in score_data:
        #偏差を求め分散のための2乗計算
        score_dispersion += (data - score_ave) ** 2
    #分散を求め標準偏差計算
    standard_deviation.append(math.sqrt(score_dispersion / len(score_data)))

#結果表示
for i in standard_deviation:
    print(f"{i:.8f}")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import statistics
ans = []
while True:
    n = int(input())
    if n == 0:
        break
    data = list(map(int, input().split()))
    v = statistics.pstdev(data)
    ans.append(v)
for a in ans:
    print(a)

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        exit()
    *a,=map(int,input().split())
    m=sum(a)/len(a)
    s=(sum([(m-ai)**2 for ai in a])/len(a))**0.5
    print(s)

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())  #得点の総数

    if n == 0:
        break

    lst = list(map(int,input().split()))  # 得点のリスト
    m = sum(lst)/n  # 平均得点

    val = 0.0

    for i in range(n):
        val += (lst[i] - m)**2

    print(math.sqrt(val/n))

Submission status: Accepted

Solution code:
import math as math
while True:
    num = int(input())
    if num ==0:
        break
    point = list(map(float,input().split()))
    ave = sum(point)/len(point)
    preS = 0
    for i in range(num):
        preS = preS + (point[i]-ave)**2
    sigma = math.sqrt(preS / num)
    print('{:.8f}'.format(sigma))

Submission status: Accepted

Solution code:
import math
while True:
    
    n = int(input())
    if n == 0:
        break
    else:
        pass
    
    s = list(map(int, input().split()))
    
    m = sum(s) / len(s)
    
    result = 0
    for i in range(n):
        result += pow(s[i] - m, 2)
        
    result = result / n
    
    print(pow(result, 0.5))

Submission status: Accepted

Solution code:
import math
while True:
	n = int(input())
	if n==0:
		break
	data = list(map(int, input().split()))
	m = sum(data)/n
	print("{:.10f}".format(math.sqrt(sum(((x-m)**2 for x in data))/n)))

Submission status: Accepted

Solution code:
import math

while True:

    # 学生の数を受け取る
    n = int(input())
    if n == 0:
        break
    
    # 学生の点数を受け取る
    score = [i for i in map(int, input().split())]
    
    # 標準偏差aを求める
    m = sum(score) / n
    tmp = 0
    for j in range(n):
        tmp += (score[j] - m) ** 2
    a = math.sqrt(tmp / n)
    print(a)

    continue

Submission status: Accepted

Solution code:
import math


if __name__ == "__main__":

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

        if n == 0:
            break

        param = input().split(" ")
        scores = [int(a) for a in param]

        average = sum(scores)/len(scores)
        variance = sum([(a - average)**2 for a in scores])/len(scores)
        stddev = math.sqrt(variance)

        print(str(stddev))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    scores = [float(i) for i in input().split()]
    mean = sum(scores) / n
    std = (sum([(i - mean)**2 for i in scores]) / n) ** 0.5
    print(std)

Submission status: Accepted

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

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) / len(s)
    sig = 0
    for i in range(len(s)):
        sig += (s[i]-m)**2
    a = math.sqrt(sig/n)
    print('{:.8f}'.format(a))

Submission status: Accepted

Solution code:
import statistics as st

while True:
    student_n = int(input())
    if student_n == 0:
        break
    
    score_lst = map(int, input().split())
    
    print(st.pstdev(score_lst))

Submission status: Accepted

Solution code:
while True:
    num = int(input())
    if num == 0:
        break
    else:
        sigma = 0
        score = list(map(int, input().split(" ")))
        mean = sum(score) / num
        for i in range(num):
            sigma += (score[i] - mean) ** 2
        alfa = (sigma / num) ** 0.5
        print(round(alfa, 8))

Submission status: Accepted

Solution code:
import math
ans=[]
while(True):
	n=int(input())
	if(n==0):
		break
	s=list(map(int,input().split()))
	ave=sum(s)/n
	diff_sum_bi=sum([(s[i]-ave)**2 for i in range(n)])
	variance=diff_sum_bi/n
	ans.append(math.sqrt(variance))

for i in range(len(ans)):
	print(ans[i])

Submission status: Accepted

Solution code:
from math import *
while True:
    n = int(input())
    if n == 0:
        exit()
    s = list(map(int, input().split()))
    m = sum(s) / n
    a = sqrt(sum(map(lambda x: pow((x - m), 2), s)) / n)
    print(a)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n==0:
        break
    s = list(map(int, input().split()))
    sum = 0.0
    for i in range(n):
        sum += s[i]
    average = sum / n
    a2 = 0.0
    for i in range(n):
        a2 += (s[i]-average)**2 / n
    a = math.sqrt(a2)
    print('%.8f'%a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while input()!='0':
    v=list(map(int, input().split()))
    m=sum(v)/len(v)
    sum_sq=0
    for i in range(len(v)):
        sum_sq=(v[i] -m)**2+ sum_sq
    
    print((sum_sq/len(v))**0.5)

Submission status: Accepted

Solution code:
devlist = []
while True:
    n = int(input())
    if n == 0:
        break
    else:
        s = list(map(float, input().split()))
        vari = 0
        mean = sum(s)/n
        for i in range(n):
            vari += ((s[i]-mean)**2)/n
        stdev = vari ** 0.5
        devlist.append(stdev)

for i in range(len(devlist)):
    print("{:8f}".format(devlist[i]))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n==0:
        break
    s = list(map(int,input().split()))
    m = sum(s)/n
    sd = (sum(list(map(lambda x:(x-m)**2,s)))/n)**0.5
    print(sd)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    a2 = list(map(lambda x: x**2, a))
    av = sum(a) / len(a)
    print(math.sqrt(sum(a2) / len(a2) - av**2))

Submission status: Accepted

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

    s = [ float(s) for s in input().split() ]
    m = sum(s)/n
    a2 = [ (d-m)**2 for d in s ]
    print(math.sqrt(sum(a2)/n))

Submission status: Accepted

Solution code:
from math import *
from statistics import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    while input()!="0":
        aa = list(map(int, input().split()))
        print(pstdev(aa))

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
results = []

while True:
    n = int(input())

    if n == 0:
        break

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

    mean = sum(l) / n

    res = 0
    for i in range(n):
        res += (mean - l[i]) ** 2

    results.append((res/n) ** (1/2))

for result in results:
    print(result)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n==0:
        break
    else:
        l = input().split()
        m = 0.0000
        s = 0.0000
        for i in range(n):
            m = m + float(l[i])
        m = m/n
        for i in range(n):
            s = s + (float(l[i])-m)**2
        print(math.sqrt(s/n))

Submission status: Accepted

Solution code:
import math

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

    S = list(map(int, input().split()))
    avg = sum(S) / n    
    x = 0
    for s in S:
        x += (s - avg)**2
        
    print(math.sqrt(x/n))

Submission status: Accepted

Solution code:
from statistics import pstdev

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

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    
    if n == 0:
        break
    
    S = [int(i) for i in input().split()]
    m = sum(S) / n
    
    a2 = sum([(s-m)**2 for s in S]) / n
    
    print(a2**0.5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    ave = sum(a)/n
    sigma = 0
    for i in range(n):
        sigma += (a[i]-ave)**2
    print(math.sqrt(sigma/n))

Submission status: Accepted

Solution code:
from math import *
n = int(input())
while True:
    if n == 0:
        break
    ss = list(map(int, input().split()))
    avr = sum(ss)/n
    s2 = sum([(x - avr)**2 for x in ss]) / n
    print(sqrt(s2))
    n = int(input())

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    else:
        score=list(map(int, input().split()))
        s_average=sum(score)/n
        devia=(sum(list(map(lambda x: (s_average-x)**2,score)))/n)**0.5
        print(devia)

Submission status: Accepted

Solution code:
import math
while (int(input())):
    x=[float(k) for k in input().split()]
    n=len(x)
    m=sum(x)/n
    print(math.sqrt(sum([(t-m)**2 for t in x])/n))

Submission status: Accepted

Solution code:
import statistics

while True:
    dev = input()
    if dev == '0': break
    
    l = [float(i) for i in input().split()]
    pstdev = statistics.pstdev(l)
    print(pstdev)

Submission status: Accepted

Solution code:
import math
n = int(input())
while(n != 0):
    s = []
    s[:] = map(int,input().split())
    sigma2 = 0.0
    average = 0.0
    for _ in range(0,n):
        average += s[_]

    average = average / float(n)

    for _ in range(0,n):
        sigma2 += (s[_]-average)**2
    sigma2 = sigma2 / float(n)
    sigma = math.sqrt(sigma2)
    print(sigma)
    n = int(input())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    else:
        arr_s = list(map(int, input().split()))
        m = sum(arr_s) / n
        t = 0
        for si in arr_s:
            t += (si - m) ** 2
        print(math.sqrt(t / n))

Submission status: Accepted

Solution code:
from statistics import pstdev

while input()!="0":
   s=list(map(int,input().split()))
   print(pstdev(s))

Submission status: Accepted

Solution code:
import math
while True:
    N = int(input())
    if N == 0:break
    table = list(map(int,input().split()))

    B = sum(table)/N

    squre_table =  [i ** 2 for i in table]
    A = sum(squre_table)/N
    
    print("%.10f"%(math.sqrt(A-B*B)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import statistics as st
while True:
    n = int(input())
    if n == 0:
        break
    s = list(map(float, input().split()))
    print(st.pstdev(s))

Submission status: Accepted

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

    scores=[]
    total=0

    scores=list(map(int,input().split(" ")))
    for score in scores:
        total+=score

    average=total/len(scores)
    hensa=0

    for score in scores:
        hensa+=(score-average)**2

    std=math.sqrt(hensa/len(scores))
    print("{:.8f}".format(std))

Submission status: Accepted

Solution code:
import math
while(1):
    n=int(input())
    s=[]
    if n== 0:
        break
    s=list(map(int,input().split()))
    mean = int(sum(s))/int(len(s))
    ss=0
    for i in range(len(s)):
        ss += (s[i]-mean)**2
    std = math.sqrt(ss/n)
    print(std)

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
    d=math.sqrt(sum((m-i)**2 for i in s)/n)
    print(d)

Submission status: Accepted

Solution code:
from math import sqrt

results = []

while True:
    n = int(input())
    if n == 0:
        break
    points = list(map(int, input().split()))
    
    mid = sum(points) / n
    variance = 0
    for point in points:
        variance += (point - mid) ** 2
    variance /= n
    
    deviation = sqrt(variance)
    results.append(deviation)

for result in results:
    print(result)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    else:
        s = list(map(int, input().split()))
        m = 0
        for i in range(n):
            m += s[i]
        m = m/n

        a2 = 0
        for j in range(n):
            a2 += (s[j]-m)**2
        a2 = a2/n

        print(a2**0.5)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    else:
        lst = list(map(int,input().split()))
        sum1 = sum(lst)
        m = sum1 / n
        for i in range(n):
            lst[i] = (lst[i] - m)**2
        sum2 = sum(lst)
        α = (sum2 / n)**0.5
        print('{:.8f}'.format(α))

Submission status: Accepted

Solution code:
while 1:
    n=int(input())
    if n==0:break
    box=list(map(float,input().split()))
    mean=sum(box)/n
    for i in range(n):
        box[i]=(box[i]-mean)**2
    print("%.10f"%((sum(box)/n)**0.5))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
from statistics import pstdev

while True:
    n = int(input())
    if not n:
        break
    li = [int(i) for i in input().split()]
    print(pstdev(li))

Submission status: Accepted

Solution code:
while 1:
    n = int(input())
    if n == 0: break
    s = [int(x) for x in input().split()]
    m = sum(s) / len(s)
    tmp = 0
    for _ in s:
        tmp += (_ - m) ** 2
    alpha = (tmp / len(s)) ** 0.5
    print(format(alpha,  '.6f'))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    a = [float(i) for i in input().split()]
    average = sum(a) / n
    print((sum([(i - average) ** 2 for i in a]) / n) ** 0.5)