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 True:
  total_scores = int(input())

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

  average_of_scores = sum(scores) / total_scores

  deviation_total = 0

  for score in scores:
    deviation_total += math.pow((score - average_of_scores), 2)

  variance = deviation_total / total_scores

  standard_deviation = math.sqrt(variance)  
  standard_deviation = "{:.8f}".format(standard_deviation)

  print(standard_deviation)

Submission status: Accepted

Solution code:
import math
S = list(map(int, open(0).read().split()))
i = 0
while i < len(S):
    n = S[i]
    if n == 0:
        break
    s = S[i+1:i+1+n]
    i+=(1+n)
    avg = sum(s) / n
    a2 = sum([(avg - x)**2 for x in s]) / n
    a = math.sqrt(a2)
    print("{:.8f}".format(a))

Submission status: Accepted

Solution code:
import math
while True:
    n=int(input())
    if n==0:
        break
    
    lis=list(map(int,input().split()))
    m=sum(lis)/n
    s=0
    for i in range(n):
        s+=(lis[i]-m)*(lis[i]-m)
    a=math.sqrt(s/n)
    print("{:10f}".format(a))

Submission status: Accepted

Solution code:
import math
while True:
    n=int(input())
    if n==0:
        break
    else:
        s=list(map(int,input().split()))
        S=sum(s)
        m=S/n
        a2=0
        for j in range(n):
            a2+=(s[j]-m)**2
        a2=a2/n
        a=math.sqrt(a2)
        print(f'{a:.4f}')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break    
    else:    
        s=list(map(int,input().split()))
        h=(sum(s))/n
        a=0
        for i in range(n):
            a+=(s[i]-h)**2
            b=(a/n)**(1/2)
        print('{:.8f}'.format(b))

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)
 a = math.sqrt(sum((i-m)**2 for i in s)/len(s))
 print(format(a,'.8f'))

Submission status: Accepted

Solution code:
#65 標準偏差

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
    import math
    ans = math.sqrt(v/n)
    
    print("{:.5f}".format(ans))

Submission status: Accepted

Solution code:
import math
B=0

while True:
    N=int(input())
    
    if N==0:
        break
    L=list(input().split())
    L=[int(s) for s in L]
    M=sum(L)/len(L)
    
    for i in range(N):
        B+=(L[i]-M)**2
        i+=1
    
    A=B/N
    A=math.sqrt(A)
    
    print(A)
    B=0

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    lst=[float(s) for s in input().split()]
    m=sum(lst)/n
    lst1=[]
    for i in range(n):
        x=(lst[i]-m)**2
        lst1.append(x)
    print(f'{(sum(lst1)/n)**(1/2):10.8f}')

Submission status: Accepted

Solution code:
import math
ans=[]
while True:
  n=int(input())
  if n==0:
    break
  S=list(map(int,input().split(' ')))
  mean=0

  for i in range(n):
    mean+=S[i]
  mean/=n

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

  a2/=n
  a=math.sqrt(a2)
  ans.append(a)


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce


def resolve():
    while (True):
        n = int(input())
        if n == 0:
            break
        ss = list(map(int, input().split()))

        m = sum(ss) / n
        a2 = reduce(lambda x, y: x + (y - m) ** 2, ss, 0)
        print((a2 / n) ** 0.5)


resolve()

Submission status: Accepted

Solution code:
import math

while True:
    n = float(input())
    if n == 0:
        break
    nums = list(map(int, input().split()))

    avg = sum(nums) / n
    a = []
    for s in nums:
        a.append(abs(s - avg) ** 2)
    print(math.sqrt(sum(a) / n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    li = [int(x) for x in list(input().split())]
    stdev = statistics.pstdev(li)
    print(round(stdev, 8))

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

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

Submission status: Accepted

Solution code:
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(n):
        sig=sig+(s[i]-m)**2
    print('{:.5f}'.format((sig/n)**(1/2)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

    buf = input().split()
    dataset = []
    sum = 0
    for i in range(n):
        dataset.append(int(buf[i]))
        sum += dataset[i]

    ave = sum / n

    v_sum = 0
    for i in range(n):
        v_sum += (dataset[i] - ave) ** 2

    v = v_sum / n

    print(math.sqrt(v))

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 range(n):
            a += (s[i]-m)**2
        b = a/n
        print(math.sqrt(b))

Submission status: Accepted

Solution code:
import math
while True:
    try:
        n=int(input())
        if n==0:
            break
        else:
            x=list(map(int,input().split()))
            s=sum(x)
            ave=s/n
            y=[]
            for i in range(n):
                m=(x[i]-ave)*(x[i]-ave)
                y.append(m)
            a=sum(y)/n
            print(math.sqrt(a))
                
            
    except EOFError:
        pass

Submission status: Accepted

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

import math

def main():
    while True:
        n = int(input())
        if n==0:
            break
        scores=[]
        scores=list(map(int,input().split()))
        avg=sum(scores)/len(scores)
        datas=len(scores)
        tmp=0
        for score in scores:
            tmp+=(score-avg)**2
        print(math.sqrt(tmp/datas))

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    students = list(map(int,input().split()))
    sum_s = sum(students)
    ave = sum_s/n
    bun = 0
    for s in students:
        bun += (ave - s) ** 2
    bun /= n

    print(math.sqrt(bun))

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

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    
    a=list(map(int,input().split()))
    
    ave=sum(a)/n
    
    k=0
    m=0
    for i in range(n):
        k=(a[i]-ave)**2
        m+=k
    
    s=(m/n)**(1/2)
    print('{:.8f}'.format(s))

Submission status: Accepted

Solution code:
import math


def deviation(data: list):
    ave = sum(data) / len(data)
    return math.sqrt(sum([(d - ave) ** 2 for d in data]) / n)


while True:
    n = int(input())
    if n == 0:
        break
    data =  [int(i) for i in input().strip().split()]
    print(deviation(data))

Submission status: Accepted

Solution code:
for i in range(10**6):
    n=int(input())
    if n==0:
        break
    L=list(map(int,input().split()))
    Ave=sum(L)/n
    CV=0
    for j in range(n):
        CV+=(L[j]-Ave)**2
    print((CV/n)**0.5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    tot = 0
    ave = 0
    moto = 0
    if n == 0:
        break
    s = list(map(int,input().split()))
    for i in range(n):
        tot += s[i]
    ave = tot/n
    for i in range(n):
        moto += (s[i]-ave)**2
    bunsan = moto/n
    hh = math.sqrt(bunsan)
    print('{:.8f}'.format(hh))

Submission status: Accepted

Solution code:
import math

i = 0
j = 0
k = 0
n = []
s = []
while True:
    n.append(int(input()))
    if n[i] == 0:
        break

    s.append(list(map(int, input().split())))
    i += 1

a = [] * (len(n) - 1)

while True:
    if j == len(n) - 1:
        break

    sumsum = 0
    avr = sum(s[j]) / n[j]
    for k in range(n[j]):
        sumsum += (s[j][k] - avr) ** 2
    
    print(math.sqrt(sumsum / n[j]))

    j += 1

Submission status: Accepted

Solution code:
import math


while True:

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

    else:
        point = list(map(int, input().split()))

        average = sum(point)/len(point)

        p_sum = []

        for i in range(n):
            delta = (point[i] - average)**2
            p_sum.append(delta)

        sigma = math.sqrt(sum(p_sum) / len(point))

        print(sigma)

Submission status: Accepted

Solution code:
while True:
    num = int(input())
    if num == 0:
        break
    scores = [int(n) for n in input().split()]
    
    mean = sum(scores) / num
    sums = 0
    for index in range(num):
        sums += (scores[index] - mean) ** 2
    print((sums / num) ** 0.5)

Submission status: Accepted

Solution code:
def cal(a,b):
    return a-b
while True:
    n = int(input())
    if n == 0:
        break
    data = list(map(int,input().split()))
    avg = sum(data)/len(data)
    temp = list(map(lambda x:(x-avg)**2,data))
    mean = (sum(temp)/len(temp))**0.5
    print(mean)

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

Submission status: Accepted

Solution code:
import statistics
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
         break
    a = list(map(int,input().split()))
    s = 0
    for i in range(n):
        s += a[i]
    S = s/n
    h = 0
    for j in range(n):
        h += ((a[j]-S)**2)/n
    c = math.fabs(math.sqrt(h))
    print(f'{c:.8f}')

Submission status: Accepted

Solution code:
import math
if __name__ == '__main__':
    def sig(s, m):
        ans = (s-m)**2
        return ans

    while(True):
        n = int(input())
        if n == 0:
            break
        ds = input()
        s = ds.split()
        ave = sum([int(i) for i in s])/len(s)
        ans = 0
        for sn in s:
            ans += sig(int(sn), ave)
        else:
            ans = math.sqrt(ans/len(s))

        print(ans)

Submission status: Accepted

Solution code:
import statistics

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
while True:
    N = int(input())
    if N == 0:
        break
    S = list(map(int, input().split()))
    SS = [x**2 for x in S]

    avg_S = sum(S)/len(S)
    avg_SS = sum(SS)/len(SS)
    print(math.sqrt(avg_SS - avg_S**2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
results = []

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

    s = list(map(float, input().split()))
    mean = sum(s)/len(s) 
    s = list(map(lambda x: (x - mean)**2, s))
    d = math.sqrt(sum(s)/ len(s))
    results.append(d)

for result in results:
    print(result)

Submission status: Accepted

Solution code:
import math

while(True):
    n = int(input())
    if n == 0:
        break
    
    s = []
    s = [int(i) for i in input().split()]
    average = sum(s) / n
    a = 0
    for i in range(n):
        a += pow(s[i] - average,2)
    se = math.sqrt(a/n)  
    print('{:.10f}'.format(se))

Submission status: Accepted

Solution code:
import math

while True:
    result = 0
    sums = 0
    num = int(input())
    if num == 0:
        break
    results = input().split(' ')
    for i in results:
        sums += int(i)
    average = sums / len(results)
    for i in results:
        result += (int(i) - average) ** 2
    
    result = result / len(results)
    
    print('{:.8f}'.format(math.sqrt(result)))

Submission status: Accepted

Solution code:
from statistics import pstdev

while True:
    n = int(input())
    if not(n):
        break
    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
    a = 0
    l = list(map(int, input().split()))
    m = sum(l)
    m = m / n
    for i in l:
        a += math.pow(i-m, 2)
    a /= n
    a = math.sqrt(a)
    print(a)

Submission status: Accepted

Solution code:
# import numpy as np
import statistics
while True:
    n = int(input())
    if n == 0:
        break
    list_point = [int(_) for _ in input().split()]
    average = statistics.mean(list_point)
    list_from_ave2 = [(list_point[i] - average)**2 for i in range(n)]
    sigma2 = sum(list_from_ave2) / n
    sigma = sigma2 ** (1 / 2)
    
    print(f"{sigma:.5f}")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

while(True):
  n = int(input())
  if (n == 0):
    break
    
  s = [float(num) for num in input().split()]
  m = sum(s)/len(s)
  
  a2 = 0
  for ss in s:
    a2 += (ss-m)**2
  a2 /= n
  print(math.sqrt(a2))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

while True:
    n=int(input())
        
    if n==0:
        break
    l=list(map(int,input().split()))
    m=sum(l)/len(l)
    
    s=[]
    for i in range(n):
        k=(l[i]-m)**2
        s.append(k)
    
    print(math.sqrt(sum(s)/n))

Submission status: Accepted

Solution code:
import math
while True:
    peple = int(input())
    Sum = 0
    Sumhen = 0
    if peple == 0:
        break
    test = [int(x) for x in input().split()]
    for i in range(peple):
        Sum += test[i]
    j = Sum/float(peple)
    for k in range(peple):
        Sumhen += (test[k] - j)**2
    print("{0:.8f}".format(math.sqrt(Sumhen/float(peple))))

Submission status: Accepted

Solution code:
from math import sqrt
while True:
  n = int(input())
  if n == 0:
    break
  else:
    score = list(map(int, input().split()))
    ave = sum(score) / n
    diviation = [(ave-i)**2 for i in score]
    variance = sum(diviation) / n
    standard_diviation = sqrt(variance)
  print(standard_diviation)

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 si in s:
        a+=(si-m)**2
    b=(a/n)**0.5
    print("{:.5f}".format(b))

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

Submission status: Accepted

Solution code:
import math
while True:
    n=int(input())
    if n == 0:
        break
    a=list(map(int,input().split()))
    m=sum(a)/n
    z=0
    for i in range(n): 
        x=a[i]-m
        y=x**2
        z += y
    b=z/n
    c=math.sqrt(b)
    print('{:.8f}'.format(c))

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
    score=list(map(int,input().split()))
    mean=sum(score)/n
    var_sum=0
    for i in range(n):
        var_sum+=(score[i]-mean)**2
    print((var_sum/n)**0.5)

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
    ssum=0
    for i in s:
        ssum+=(i-ave)*(i-ave)
    print(math.sqrt(ssum/n))

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)
    m = m / n
    
    x = 0
    a = 0
    for i in range(n):
        S = data[x]
        X = (S - m)**2 / n
        a = a + X
        x = x + 1
    
    print(math.sqrt(a))

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    
    s=list(map(int,input().split()))
    m=sum(s)/n
    sa=0

    for i in range(n):
        sa+=(s[i]-m)**2
    
    a2=sa/n
    a=a2**(1/2)
    print(a)

Submission status: Accepted

Solution code:
from statistics import pstdev

for _ in range(1000):
    n = int(input())

    if n == 0:
        break

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

#pstdev:n法
#stdev：n-1法
    print(pstdev(arg))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 標準偏差を求める
# N:人数
# s1 s2 .. sN:スコア
import math
while True:
    N = int(input())
    if N == 0: break
    s = list(map(int, input().split()))
    m = sum(s) / len(s)
    print(math.sqrt(sum([(s-m)**2 for s in s])/N))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
import math

while True:
    n = int(stdin.readline().rstrip())
    if n == 0:
        break
    l = list(map(int, stdin.readline().split()))
    s = 0
    for i in l:
        s += i
    m = s / n
    a = 0
    for i in l:
       a += math.pow((i - m),2)
    variance = a / n
    stdev = math.sqrt(variance)
    print('{0:.8f}'.format(stdev))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    S = list(map(int,input().split()))
    Ave = sum(S)/n
    sum2 = 0
    for x in S:
        sum2 += (x-Ave)**2
    Std = (sum2/n)**0.5
    print(Std)

Submission status: Accepted

Solution code:
output = []
while True:
    number = int(input())
    if number == 0:
        break
    table = list(map(int, input().split()))

    tmp_sum = 0
    for i in range(len(table)):
        tmp_sum += table[i]
    average = tmp_sum / len(table)

    squared_sum = 0
    for i in range(len(table)):
        squared_sum += (table[i] - average) ** 2
    standard_deviation = (squared_sum / len(table)) ** 0.5
    output.append(standard_deviation)
for i in output:
    print('{:.10f}'.format(i))

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
    a=x/n
    print(math.sqrt(a))

Submission status: Accepted

Solution code:
from statistics import pstdev

while True:
    n = int(input())
    if n == 0:
        break
    else:
        S = list(map(float, input().split()))

        print(pstdev(S))

Submission status: Accepted

Solution code:
y = []
while True:
    n = int(input())
    if n == 0:
        break
    x = list(map(float,input().split()))
    m = sum(x)/n
    v = list(map(lambda l: (l-m)**2,x))
    y.append((sum(v)/n)**0.5)
for i in range(len(y)):
    print(y[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import statistics

input = sys.stdin.readline

def main():
    while True:
        n = int(input().rstrip())
        if n == 0:
            sys.exit()
        s = list(map(int, input().rstrip().split()))
        print(statistics.pstdev(s))
        
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def standard_deviation(ls):
    n=len(ls)
    ave=sum(ls)/float(n)
    var=.0
    for x in ls:
        var+=((x-ave)**2)/float(n)
        
    return math.sqrt(var)
    
    

def run():
    
    while True:
    
        n=int(input())
        
        if n==0:
            break
        
        ls=list(map(float,input().split()))
            
        
        var=standard_deviation(ls)
        print(f"{var}")
        

run()

Submission status: Accepted

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

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

    aa = 0

    for e in s:
        aa += (e-m)**2
    
    aa /= n
    aa **=0.5

    print("{:.10f}".format(aa))

Submission status: Accepted

Solution code:
import math
dataset=[]
while True:
	num=int(input())
	if num==0:
		break
		
	scores=[int(x) for x in input().split(' ')]
	dataset.append([num,scores])


for d in dataset:
	num=d[0]
	scores=d[1]
	fsum=sum(scores)
	average=fsum/num

	sts=[i-average for i in scores]
	bunsan=sum([i**2 for i in sts])/num
	sd=math.sqrt(bunsan)
	print("{:.4f}".format(sd))

Submission status: Accepted

Solution code:
import math

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

    score_list = list(map(int, input().split()))
    ave = sum(score_list) / n
    a2 = 0
    for s in score_list:
        a2 += (s - ave)**2
    a2 /= n
    a = a2**0.5
    print(a)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    x = list(map(int, input().split()))
    
    y = sum(x)/n
    a = 0
    for i in range(n):
        a += (x[i]-y)**2
    
    m = math.sqrt(a/n)
    print(f'{m:.8f}')

Submission status: Accepted

Solution code:
# coding: utf-8
# 65
import statistics
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

while True:
    n = int(input())
    if n==0: break
    s = list(map(int,input().split()))
    
    r = 0
    m = sum(s)/n
    
    for i in range(n): r += (s[i]-m)**2
    print("{:.8f}".format((r/n)**.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
    
    S = 0
    for i in range(n):
        S += (s[i]-m)**2

    a2=  math.sqrt(S/n)



    print('{:.8f}'.format(a2))

Submission status: Accepted

Solution code:
import  math

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

    score=list(map(int,input().split()))
    m=float(sum(score)/n)
    er=[(score[i]-m)**2 for i in range(n)]
    var=sum(er)/n
    sigma=math.sqrt(var)
    print(sigma)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
for i in range(10**5):
    n = int(input())
    if n == 0:
        break
    else:
        s = list(map(int,input().split()))
        k = sum(s)/n
        ans = 0
        for i in range(n):
            ans += ((s[i]-k)**2)/n
        print("{:.10}".format(ans**0.5))

Submission status: Accepted

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

    if n == 0:
        break

    score = list(map(float, input().split()))
    ave = sum(score)/float(n)

    score_sum = 0.0

    for i in range(n):
        score_sum += (score[i]-ave)**2

    sigma = (score_sum/float(n))**0.5

    print('{:.08f}'.format(sigma))

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n==0: break
    S = list(map(int, input().split()))
    mean = sum(S) / n
    dev = sum([(s-mean)**2 for s in S]) / n
    sigma = math.sqrt(dev)
    print(sigma)

Submission status: Accepted

Solution code:
import math
while True:
    n=int(input())
    if n==0:
        break
    else:
        s=list(map(int,input().split()))
        S=sum(s)
        m=S/n
        i=0
        a=[]
        for i in range(n):
            i+=1
            ai=float((s[i-1]-m)**2)
            a.append(ai)
        A2=sum(a)/n
        A=math.sqrt(A2)
        print(f'{A:.8f}')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

   s = list(map(int, input().split()))
   
   m = sum(s) / n
   b = 0
   for i in range(n):
      b += (s[i] - m) ** 2
   
   ans = (b / n) ** 0.5
   print(ans)

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n == 0:
        break
    s = list(map(int, input().split()))
    s_ = sum(s) / n
    alpha = 0
    for i in s:
        alpha += (i - s_) ** 2
    print(format(math.sqrt(alpha/n), '.8f'))

Submission status: Accepted

Solution code:
def resolve():
    import math
    n = int(input())
    while n != 0:
        sn = [int(i) for i in input().split()]
        m = sum(sn) / n
        sumA = 0
        for s in sn:
            sumA += ((s - m)**2) / n
        print(math.sqrt(sumA))
        n = int(input())


resolve()

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n == 0:
        break
    s = [int(i) for i in input().split()]
    average = sum(s) / n
    dispersion = 0
    for i in range(n):
        dispersion += (s[i] - average) ** 2 / n
    dispersion = math.sqrt(dispersion)
    print("{:.8f}".format(dispersion))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

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