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:
while True:
    n = int(raw_input())
    if n == 0: break
 
    x = map(int, raw_input().split())
    ave = sum(x) / float(n)
    std = (sum([(e-ave)**2 for e in x])/n)**0.5
    print std

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

# 標準偏差を求める
def standard_deviation():
    average = sum(s) / n  # 平均値を求める
    total_deviation = 0
    for element in s:
        total_deviation += (element - average)**2 # 偏差の合計を求める

    return math.sqrt(total_deviation / n) # 標準偏差を求める


while True:
    n = int(input())
    if n == 0: break
    s = [int(s) for s in input().split()]
    print('{0:.5f}'.format(standard_deviation()))

Submission status: Accepted

Solution code:
# AOJ ITP1_10_C

import math

def intinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    while True:
        n = int(input())
        if n == 0: break
        data = intinput()
        sum_1 = 0  # 1乗の総和
        sum_2 = 0  # 2乗の総和
        for i in range(n):
            sum_1 += data[i]; sum_2 += data[i] ** 2
        # print('(%d, %d)' % (sum_1, sum_2))
        sigma = math.sqrt((sum_2 / n) - ((sum_1 / n) ** 2))
        print(sigma)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0: break
    s = [int(e) for e in input().split()]
    average = sum(s) / n
    total = 0
    for e in s:
        total += (e - average)**2 # 偏差の２乗の合計
    print("{0: .4f}".format(math.sqrt(total/n)))

Submission status: Accepted

Solution code:
import math
while 1:
    n = int(input())
    if n == 0 :
        break
    a = list(map(int,input().split()))
    ave = sum(a)/n
    s = 0
    for i in range(n):
        s += (a[i] - ave)**2
    s2 = math.sqrt(s / n)
    print("%.9f"%s2)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    li = list(map(int, input().split()))
    avg = sum(li)/n
    S = sum([(li[i]-avg)**2 for i in range(n)]) / n
    print(f"{math.sqrt(S):0.9f}")

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

Submission status: Accepted

Solution code:
n = int(input())
while n:
    d  = [int(i) for i in input().split()]
    print((sum([(i - sum(d) / n)**2 for i in d]) / n)**0.5)
    n = int(input())

Submission status: Accepted

Solution code:
import math


result = []
n = int(input())

while n != 0:
    d = list(map(int, input().split()))
    mean = sum(d) / n
    var = [(i - mean) ** 2 for i in d]
    var = math.sqrt(sum(var) / n)
    result.append(var)
    
    n = int(input())

for i in result:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

while 1 :
    n = int( input().strip() )
    if n == 0 :
        break

    s = input().strip().split()
    for i in range(0, len(s)) :
        s[i] = float(s[i])

    m = sum(s)/n

    sigma = sum( [ ( si - m ) ** 2 for si in s ] )

    a = math.sqrt( sigma/n )
    print("{0:.8f}".format(a))

Submission status: Accepted

Solution code:
# Standard Deviation

end = 0
while end == 0:
    studentAmount = int(input())
    if studentAmount == 0:
        end += 1
    else:
        scoreData = [int(i) for i in input().rstrip().split()]
        totalScore = 0
        for score in scoreData:
            totalScore += score
        averageScore = totalScore / studentAmount
        # print('Average: ' + str(averageScore))
        totalSquareDistance = 0
        for score in scoreData:
            totalSquareDistance += (score - averageScore) ** 2
        variance = totalSquareDistance / studentAmount
        # print('Variance: ' + str(variance))
        standardDeviation = variance ** 0.5
        # print('Standard Deviation: ', end = '')
        print(str(standardDeviation))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

while True:
	d =0
	n = int(input())
	if n == 0:
		break
	s = list(map(int, input().split()))
	avg = sum(s) / len(s)
	for i in s:
		c = (i - avg) ** 2
		d += c
	a2 = d / len(s)
	print(math.sqrt(a2))

Submission status: Accepted

Solution code:
import math

while True:
    n = int(raw_input())
    if n == 0:
        break
    s = map(int, raw_input().split())
    m = float(sum(s)) / n
    a2 = (sum(map(lambda x: (x-m)**2, s))) / n
    a = math.sqrt(a2)
    print("%f" % (a, ))

Submission status: Accepted

Solution code:
import sys
 
mode = 0
for line in sys.stdin:
    if mode == 0:
        n = int(line.strip('\n'))
        if n == 0: break
        mode = 1
    elif mode == 1:
        x = [float(i) for i in line.strip('\n').split()]
        ave = sum(x) / n
        std = (sum([(i-ave)**2 for i in x])/n)**0.5
        print std
        mode = 0

Submission status: Accepted

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

    x = map(int, raw_input().split())
    ave = sum(x) / float(n)
    std = (sum([(e-ave)**2 for e in x])/n)**0.5
    print std

Submission status: Accepted

Solution code:
import math
while 1:
        n=input()
        if n==0:
                break
        s=map(int,raw_input().split())
        m=0.0
        for i in range(n):
                m+=s[i]
        m=m/n
        a=0.0
        for i in range(n):
                a+=(s[i]-m)**2
        a=(a/n)**0.5
        print a

Submission status: Accepted

Solution code:
from __future__ import division, print_function
from sys import stdin
from math import sqrt
while True:
    n = int(stdin.readline())
    if n == 0:
        break
    data = [float(s) for s in stdin.readline().split()]
    m = sum(data) / len(data)
    print('{:.4f}'.format(sqrt(sum((s-m)**2 for s in data) / n)))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import io
import re
import math

while True:
#    i = 0
    n = int(raw_input())
    if n==0: break
    l = map(float, raw_input().split())
# hyojunhensa**2 = sum(tokuten-heikinten)**2)/ninzu
    avg=sum(l)/len(l)
    naka=0
    for i in l:
        naka+=(i-avg)**2
    hyo2 = naka/n
    print (hyo2)**0.5

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
	n = input()
	if n == 0:
		break
	s = map(float, raw_input().split())
	v = sum(map(lambda x: x**2, s)) / n - (sum(s) / n)**2
	print v**0.5

Submission status: Accepted

Solution code:
import math
while True:
    n = int(raw_input())
    if n == 0:
        break
    stdnt = map(int, raw_input().split())
    ave = 0
    for score in stdnt:
        ave += float(score)/n
    alpha = 0
    for score in stdnt:
        alpha += (score-ave) ** 2/n
    print math.sqrt(alpha)

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n == 0: break
    d = list(map(int, input().strip().split()))
    m = sum(d) / n
    print(math.sqrt(sum((x - m)**2 for x in d) / n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
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:
i=0
while True:
    N=int(input())
    if N==0:
        break
    else:
        a = list(map(float,input().split()))
        m=sum(a)/N
        #print(m)
        for i in range(N):
            a[i]=(float)(a[i]-m)**2
            #print(a[i])
            i+=1
        
        A=(sum(a)/N)**(1/2)
        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)
    a=0
    for i in range(n) :
        a+=(s[i]-m)**2
    a/=n
    a=math.sqrt(a)
    print(a)

Submission status: Accepted

Solution code:
import math

A=[]
while True:
    n=int(input())
    if n==0 :
        break
  
  
    else :
        b=list((map(int,input().split())))
        ave=sum(b)/n
        for i in range(n):
            A.append((ave-b[i])**2)
        p=math.sqrt(sum(A)/n)
        print("{:.8f}".format(p))
        A.clear()

Submission status: Accepted

Solution code:
n=int(input())
while n!=0:
    S=0
    #print(n)
    l=input().rstrip().split()
    l=list(map(int,l))
    #print(l)
    m=sum(l)/len(l)
    #print(m)
    for i in range(len(l)):
        S+=(l[i]-m)**2
    print((S/len(l))**(1/2))
    n=int(input())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
while True:
    x = []
    n = int(input())
    if n == 0:
        break
    x = input().split( )
    suu = [float(s) for s in x]
#    print(x)
    kota = float(0)
    for a in suu:
        kota += ((a-sum(suu)/n)**2)/n
    print(math.sqrt(kota))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math
from statistics import mean
ans = []
while True:
	n = int(input())
	if n == 0:
		break
	s = list(map(int,input().split()))
	ss = []
	for i in s:
		ss.append(i**2)
	sd = math.sqrt(mean(ss)-mean(s)**2)
	ans.append(sd)
for k in ans:
	print(k)

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    lst=[int(i) for i in input().split()]
    m=sum(lst)/len(lst)
    a_2=0
    for l in range(n):
        value=lst[l]
        a_2+=pow(value-m,2)/n
    print(pow(a_2,0.5))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from enum import Enum

while True:
    n=int(input())
    if n==0:
        break
    s=list(map(int,input().split()))
    
    sum1=0
    for i in range(len(s)):
        sum1+=s[i]
    a=sum1/len(s)
    
    sum2=0
    for i in range(len(s)):
        sum2+=s[i]*s[i]
    b=sum2/len(s)
    
    print("%.10f"%(math.sqrt(b-a*a)))

Submission status: Accepted

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

while True:
    n=int(input())
    
    if n==0:
        break
    else:
        S=[int(s) for s in input().split()]
        a2=0
        
        m=sum(S)/n
        
        for i in range(n):
            a2+=(S[i]-m)**2
            a=math.sqrt(a2/n)

    print(f'{a:.5f}')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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


    h = sum(A) / len(A);
    k = 0;
    for j in range(0,n):
        k += (A[j] - h)**2;
    print(math.sqrt(k/n));

Submission status: Accepted

Solution code:
from enum import Enum
import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


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

    tmp_sum = 0
    for i in range(len(table)):
        tmp_sum += table[i]
    B = tmp_sum/len(table) #平均

    squared_sum = 0
    for i in range(len(table)):
        squared_sum += table[i]*table[i]
    A = squared_sum/len(table)

    print("%.10f"%(math.sqrt(A-B*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)/n
    aa=0
    for i in s:
        aa+= (i-m)**2
    a=math.sqrt((aa)/n)
    print(f'{a:.08f}')

Submission status: Accepted

Solution code:
import math

for i in range(1000):
    
    n=float(input())
    if n==0:
        break
    
    s= list(map(float, input().split()))
    m=sum(s)/n
    
    X=[]
    n=int(n)
    for j in range (n):
        x=(s[j]-m)**2
        X.append(x)
    a=math.sqrt(sum(X)/n)
    print(f'{a:.08f}')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


while True:
    n = int(input())
    if n == 0:
        break
    *A, = map(int, input().split())
    m = sum(A) / n
    s2 = sum((a - m) ** 2 for a in A) / n
    print("{:.8f}".format(math.sqrt(s2)))

Submission status: Accepted

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

  scr = list(map(int, input().split()))
  avg = sum(scr) / n
  v = 0
  for scri in scr:
    v += ((scri - avg) ** 2 ) / n
  a = v ** 0.5
  print(a)

Submission status: Accepted

Solution code:
from math import sqrt
def solve(n):
  s = list(map(float,input().split()))
  m = sum(s)/n
  a = sqrt(sum([(si-m)**2 for si in s])/n)
  print('{0:.6f}'.format(a))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
for i in range(1000):
    n = int(input())
    if n == 0:
        exit()
    s = list(map(int,input().split()))
    ave = sum(s) / len(s)
    num = 0
    for j in s:
        num += (j-ave)**2
    num /= len(s)
    print(num**(1/2))

Submission status: Accepted

Solution code:
from math import sqrt

while True:
    n = int(input())
    if n == 0:
        break
    
    lst = list(map(float,input().split()))
    ave = sum(lst) / len(lst)
    alpha = 0.0
    for i in lst:
        alpha += (ave - i)**2
    S = sqrt((alpha/n))
    print(S)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    N = int(input())
    if N == 0:
        break
    sum = 0
    s = input().split()
    for i in range(N):
        sum += int(s[i])
    mean = sum/N
    t = 0
    for j in range(N):
        t += (int(s[j]) - mean)**2
    b = t / N
    a = b**0.5
    print('{:.08f}'.format(a))

Submission status: Accepted

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

import math

while True :
    n = int(input())
    
    if n == 0 :
        break
    else :
        S = [int(s) for s in input().split()]
        a2 = 0
        
        m = sum(S) / n
        
        for i in range(n) :
            a2 += (S[i] - m) ** 2
            
        a = math.sqrt(a2 / n)

    print(f"{a:.5f}")

Submission status: Accepted

Solution code:
#65
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
    b=math.sqrt(a/n)
    print(b)

Submission status: Accepted

Solution code:
#
# 10c
#
import math


def main():
    while True:
        n = int(input())
        if n == 0:
            break
        s = list(map(int, input().split()))
        m = sum(s) / n
        aan = 0
        for i in range(n):
            aan += (s[i] - m)**2
        print(f"{math.sqrt(aan/n):.4f}")


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

Submission status: Accepted

Solution code:
import statistics

while True:
    n = int(input())
    if n == 0:
        break
    scores = list((int(x) for x in input().split()))
    
    std = statistics.pstdev(scores)
    
    print("{0:.8f}" . format(round(std,8)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from statistics import mean
import math

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

Submission status: Accepted

Solution code:
def bunsan(n,S): #Sはリスト
    ave = sum(S)/n
    D = 0
    
    for i in range(n):
        D += (S[i] - ave)**2
    return (D/n)**(1/2)

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

Submission status: Accepted

Solution code:
import statistics

while True:
    n = int(input())
    if n == 0:
        break
    scores = list((int(x) for x in input().split()))

    std = statistics.pstdev(scores)

    print("{0:.8f}" . format(round(std, 8)))

Submission status: Accepted

Solution code:
from math import sqrt
from statistics import mean
while True:
    n = int(input())
    if n == 0:
        break
    else:
        L = list(map(int, input().split()))
        m = mean(L)
        temp = list(map(lambda x: (x-m)**2, L))
        SD = sqrt(sum(temp) / len(L))
        print(SD)

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

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()))
    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:
while True:   
    n = int(input())
    if n ==0:
        break
    s_list=list(map(float,input().split()))
    
    m = (sum(s_list))/n
    
    ss = 0
    for i in s_list:
        si =((i-m)**2)
        ss += si  
    print((ss/n)**0.5)

Submission status: Accepted

Solution code:
import math as ma
# import statistics as stat
while True:
    n = int(input())

    if (n == 0):
        break

    score = list(map(int,input().split()))
    m = sum(score)/len(score)
    tmp = [0]*len(score)
    for i in range(len(score)):
        tmp[i] = float((score[i]-m)**2)

    s = sum(tmp)
    div =ma.sqrt(s/len(score))
    print(div)

Submission status: Accepted

Solution code:
import math
while True:
    N=int(input())
    if N==0:
      exit()
    se=0
    L=list(map(int,input().split()))
    ave=sum(L)/N
    for i in range(N):
        se+=(L[i]-ave)*(L[i]-ave)
    ans=math.sqrt(se/N)
    print(round(ans,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
    ss = 0
    for i in s:
        ss += pow((i - m), 2)
    bun = ss / n
    print(math.sqrt(bun))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

while True:
    x = int(input())
    # x = 5
    if x==0:
        break
    data = list(map(float, input().split()))
    # data = list(map(float, '70 80 100 90 20'.split()))
    average = sum(data)/x
    temp = 0
    for d in data:
        temp += math.pow(d - average, 2)
        # print(math.pow(d - average, 2))
    stdev = math.sqrt(temp / x)
    print(stdev)

Submission status: Accepted

Solution code:
import math
while True:
    n=int(input())
    if n==0:break
    else:
        s = list(map(int, input().split())) #入力の値が横並びの時使う
        x=sum(s)
        y=x/n
        a=0
        for i in range(n):
             z=(s[i]-y)**2
             a+=z
        b=math.sqrt(a/n)
        print(format(b, '.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) / float(n) #nの浮動小数点型で割る
    print("{0:.8f}".format(math.sqrt(sum([(x-m)**2 for x in s])/n)))
    #math.sqrt()で√

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    s=list(map(int,input().split()))
    m2=(sum(s)/n)**2  
    nijou=[]
    for i in s:
        nijou.append(i**2)
    m3=sum(nijou)/len(nijou)  
    print('{:.8f}'.format((m3-m2)**0.5))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input())
        if n==0:
            break
        S = list(map(int,input().split()))
    except:
        break
    mean = sum(S)/len(S)
    tmp = 0
    for s in S:
        tmp += ((s-mean)**2)/n
    print(tmp**0.5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
  n = int(input())
  if n == 0: break
  A = list(map(int, input().split()))
  m = sum(A)/n
  N = (sum((a-m)**2 for a in A)/n)**0.5
  print(f"{N:.8f}")

Submission status: Accepted

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

    *s,= list(map(int, input().split()))
    m = sum(s) / n
    v = 0
    for i in s:
        v += (i - m) ** 2
    ans = (v / n) ** (1/2)
    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 10_C
import math

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

Submission status: Accepted

Solution code:
import statistics

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

for r in results:
    print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a=[]
while True:
    tmp=int(input())
    if tmp==0:
        break
    tmp1=[]
    tmp1.append(tmp)
    tmp1.append(list(map(int,input().split(" "))))
    a.append(tmp1)
for i in a:
    ave=sum(i[1])/i[0]
    sgm=math.sqrt(sum([(i[1][j]-ave)**2 for j in range(i[0])])/i[0])
    print(sgm)

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 True:
    n = int(input())
    if n == 0:
        break
    else:
        a = list(map(int, input().split()))
        m = sum(a)/n
        sigma = 0
        for i in range(n):
            sigma += (a[i] - m)**2
        bun = sigma/n
        ans = bun**(1/2)
    print(ans)