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

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

    a = [int(x) for x in input().split()]
    
    ave = sum(a)/len(a)

    hoge = 0
    for i in a:
        hoge += (i - ave) ** 2
    hoge /= len(a)
    foo += [math.sqrt(hoge)]
for i in foo:
    print(i)

Submission status: Accepted

Solution code:
import sys
from functools import reduce
from math import sqrt

while True:
    n = int(sys.stdin.readline())
    if n == 0:
        break
    s = [int(i) for i in sys.stdin.readline().split()]
    m = sum(s) / n
    print(sqrt(sum(map(lambda x: (x - m) ** 2, s)) / n))

Submission status: Accepted

Solution code:
import math
while True:
    try:
        n = int(raw_input())
    except EOFError:
        break
    if n == 0:
        break
    ls = map(int,raw_input().split())
    m = sum(ls)/float(n)
    
    tmp_tot = 0
    for k in range(n):
        tmp_tot += (ls[k]-m)**2/float(n)
    a = math.sqrt(tmp_tot)
    print a

Submission status: Accepted

Solution code:
import math

def average(l):
    return sum(l) / len(l)

def var(l):
    a = average(l)
    return sum(map(lambda x: (x-a)**2, l)) / len(l)

def std(l):
    return math.sqrt(var(l))

if __name__ == '__main__':
    while True:
        n = int(input())
        if n == 0:
            break
        l = [int(i) for i in input().split()]
        print("{0:.5f}".format(std(l)))

Submission status: Accepted

Solution code:
#coding:utf-8
#1_10_C 2015.4.14
import math

while True:
    n = int(input())
    if n == 0:
        break
    scores = list(map(int,input().split()))
    ave = sum(scores)/n
    sd = math.sqrt(sum([(s - ave)**2 for s in scores])/n)
    print('{:.10f}'.format(sd))

Submission status: Accepted

Solution code:
import math

while True:
	n = int( raw_input() )
	if 0 == n:
		break
	s = [ float( i ) for i in raw_input( ).split( " " ) ]
	t = sum( s )
	m = t / n
	t = 0
	for val in s:
		t += ( val - m )**2
	print( math.sqrt( t/n ) )

Submission status: Accepted

Solution code:
import math

while True:
	n = int( input() )
	if 0 == n:
		break
	s = [ float( i ) for i in input( ).split( " " ) ]
	t = sum( s )
	m = t / n
	t = 0
	for val in s:
		t += ( val - m )**2
	print( math.sqrt( t/n ) )

Submission status: Accepted

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

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 = sum((x - m) ** 2 for x in s) / n
    print(a ** 0.5)

Submission status: Accepted

Solution code:
# coding=utf-8
from __future__ import division
from  math import sqrt


def mean(list_):
    return sum(list_) / len(list_)


def std(list_):
    m = mean(list_)
    return sqrt(sum([(x - m) ** 2 for x in list_]) / len(list_))

def main():
    n = input()
    while n:
        scores = map(int, raw_input().split())
        print std(scores)
        n = input()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding=utf-8
from __future__ import division
from  math import sqrt


def main():
    n = input()
    while n:
        scores = map(int, raw_input().split())
        m = sum(scores) / n
        print sqrt(sum([(x - m) ** 2 for x in scores]) / n)
        n = input()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
while 1:
    n = int(input())
    if n == 0:
        break
    L = list(map(int, input().split()))
    mean = sum(L) / len(L)
    V = sum((s - mean) ** 2 for s in L) / len(L)
    print(V ** 0.5)

Submission status: Accepted

Solution code:
import math

while True:
  n = int(raw_input())
  if n == 0:
    break
  s = map(float, raw_input().split(" "))

  sum = 0
  for i in xrange(n):
    sum += s[i]
  a = sum / n

  temp = 0
  for i in xrange(n):
    temp += (s[i] - a) ** 2
  temp = math.pow(temp / n, 0.5)

  print "{0:.6f}".format(temp)

Submission status: Accepted

Solution code:
import math
while True:
    n=input()
    if n==0: break
    s=map(int,raw_input().split())
    mean=float(sum(s))/len(s)
    var=[(x-mean)**2/n for x in s]
    print math.sqrt(sum(var))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def standard_deviation() :
	while True :
		n = input()
		if n==0 :
			break
		s_d = [0]*n
		average = 0
		standard = 0
		s_d= map(float,raw_input().split())
		for i in range(n):
			average += s_d[i]
		average /= float(n)
		for i in range(n):
			standard += pow(s_d[i]-average,2) / float(n)
		print(math.sqrt(standard))
standard_deviation()

Submission status: Accepted

Solution code:
import statistics
import sys

data_sets = sys.stdin.read().split("\n")

for i in data_sets[1:-1:2]:
    data_set = map(int, i.split())
    print(statistics.pstdev(data_set))

Submission status: Accepted

Solution code:
import statistics
import sys

data_sets = sys.stdin.read().split("\n")

for i in data_sets[1:-1:2]:
    data_set = [int(j) for j in i.split()]
    print(statistics.pstdev(data_set))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    else:
        data_set = [int(i) for i in input().split()]
        m = sum(data_set) / n
        v = 0
        for i in data_set:
            diff = i - m
            v += diff ** 2
        v /= n
        print(v ** 0.5)

Submission status: Accepted

Solution code:
import statistics

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

Submission status: Accepted

Solution code:
import math
alpha = []
while True:
    n = float(raw_input())
    if n == 0:
        break
    nums_str = raw_input().split()
    nums = []
    for s in nums_str:
        nums.append(float(s))
    ave = sum(nums)/n
    n_sum = 0.0
    for num in nums:
        n_sum += (num-ave)**2
    alpha.append(n_sum/n)
for a in alpha:
    print math.sqrt(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import *
while True:
    n = input()
    if n==0:
        break
    score_li = map(int,raw_input().split())
    score_sum = sum(score_li)
    ave = score_sum/float(n)
    variance = 0
    for i in xrange(n):
        variance += (score_li[i]-ave)**2
    variance /=float(n)
    sd = sqrt(variance) #sd:standard deviation
    print sd

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n == 0:
        break
    sn = [int(s) for s in input().split()]
    m = sum(sn) / n
    a2 = 0.0
    for s in sn:
        a2 += pow(s-m, 2)
    print(math.sqrt(a2/n))

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n == 0:
        break
    data = [int(n) for n in input().split()]
    ave = sum(data) / len(data)
    var = 0
    for s in data:
        var += (s - ave) ** 2
    print(math.sqrt(var / len(data)))

Submission status: Accepted

Solution code:
import math

n = input()
while n != 0:
    if n == 0:
        break
    tmp = map(float, raw_input().split())
    ave = 0
    for i in xrange(len(tmp)):
        ave += tmp[i] / n
    u = 0
    for i in xrange(n):
        u += (tmp[i] - ave)**2
    print "%.8f" % math.sqrt(u/n)
    n = input()

Submission status: Accepted

Solution code:
#encoding=utf-8

import sys
import math
printf = sys.stdout.write

while True:
    new_mean = 0
    x = input()
    if x == 0:
        break

    exam = map(int, raw_input().split())
    ave = float(sum(exam))/len(exam)

    for i in range(len(exam)):
        mean = ((exam[i] - ave)**2)
        new_mean += mean/len(exam)
        
    print math.sqrt(new_mean)

Submission status: Accepted

Solution code:
import math
while True:
	n = int(input())
	if n == 0:
		break
	Student=list(map(float,input().split()))
	#print(n)
	#print(Student)
	#m=average
	average=sum(Student)/n
	#print(m)
	#a^2=dispersion
	s=0.0
	for i in Student:
		s+=(i-average)**2
	dispersion=s/n
	print("%.6f"%(math.sqrt(dispersion)))

Submission status: Accepted

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

import math

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

        ave = 0.0
        for i in scores:
            ave += i
        ave /= n

        dev = 0.0
        for i in scores:
            dev += (i-ave)*(i-ave)
        dev /= n

        print math.sqrt(dev)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    dset = list(map(int, input().split()))
    mean = sum(dset)/len(dset)
    sigma = math.sqrt(sum([(x-mean)**2 for x in dset])/len(dset))
    print('%.06f' % sigma)

Submission status: Accepted

Solution code:
import math
result = []
while True:
    n = input()
    if n == 0:
        break;
    score = map(float,raw_input().split(" "))
    
    ave = sum(score)/len(score)

    alpha = math.sqrt(sum([(s-ave)**2 for s in score])/len(score))
    result.append(alpha)

for r in result:
    print r

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
while True:
    n = int(raw_input())
    if n == 0:break
    s = map(int,raw_input().split())
    do = float(sum(s))/n
    ans = (sum(map(lambda x: (x - do)**2,s)))/n
    print("%f" % math.sqrt(ans))

Submission status: Accepted

Solution code:
import math

while 1:

    # input the students number
    n = input()
    if n == 0:
        break
    # input the points
    s = map(float, raw_input().split())
    # get the average of points
    ave = 0
    for i in s:
        ave += i
    ave = ave / len(s)
    # get the standard deviation
    alpha = 0
    for i in s:
        alpha += (i - ave)*(i - ave)
    alpha = math.sqrt( alpha/len(s) )
    # print
    print alpha

Submission status: Accepted

Solution code:
import math
while 1:
    n=int(input())
    if n == 0: break 
    ss=list(map(float,input().split()))
    a=sum(ss)/n
    s=(sum([ (s-a)**2 for s in ss ]) / n)**0.5
    print('{0:.6f}'.format(s))

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 sys
import math

def str_input():
    S = raw_input()
    if S[len(S)-1] == "\r":
        return S[:len(S)-1]
    return S

def float_to_str(num):
    return str("{:.10f}".format(num))

def list_input(tp):
    return map(tp, str_input().split())

# # # # # # # # # # # # # # # # # # # # # # # # #

while 1:
    n = input()

    if n == 0:
        break

    s = list_input(float)
    m = sum(s) / n
    s = map(lambda x: x-m, s)
    s = map(lambda x: x*x, s)
    s = map(lambda x: x/n, s)
    
    print float_to_str(math.sqrt(sum(s)))

Submission status: Accepted

Solution code:

from math import sqrt

while True:
	input_data =[] # ????´??????????
	alpha = 0 # ??????
	num = int(input())
	if num == 0:
		break
	input_data = [float(i) for i in input().split()]
	m = sum(input_data) / float(num)
	for i in range(num):
		alpha += (input_data[i] - m)**2
	print(sqrt(alpha/num))

Submission status: Accepted

Solution code:
from math import sqrt
sigma=[]
while True:
	total=0
	nval=0
	n=int(input())
	if n==0:
		break

	score_list=map(float,raw_input().split(" "))

	for i in score_list:
		total+=i

	average=total/n

	for i in score_list:
		nval+=(average-i)**2
	val=nval/n
	sigma.append(sqrt(val))

for i in sigma:
	print i

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if(n == 0):
        exit()
    else:
        s = [int(x) for x in input().split()]
        m = sum(s)/len(s)

        for i in range(n):
            s [i] = (s[i] - m)**2

        print("%.5f" % (math.sqrt(sum(s)/len(s))))

Submission status: Accepted

Solution code:
import math

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

	ave = sum(li) / cnt
	n_var = 0.0
	
	for i in range(cnt):
		n_var += ( li[i] - ave )**2
	
	var = n_var / cnt
	
	print('{0:.8f}'.format(math.sqrt(var)))

Submission status: Accepted

Solution code:
# coding: utf-8

import math

ans = []

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

Submission status: Accepted

Solution code:
import math

while True:
    n = int(input())
    if n == 0:
        break
    s = [int(x) for x in input().split()]
    m = sum(s) / n
    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:
while True:
    n = int(input())
    if n == 0:
        break
    s = [int(x) for x in 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:
while True:
    n = int(input())
    if n == 0:
        break
    s = [float(x) for x in 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:
import sys

while True:
    n = int(input())
    if n == 0:
        break
    s = [int(x) for x in sys.stdin.readline().split()]
    m = sum(s) / n
    a = (sum([(x - m) ** 2 for x in s]) / n) ** 0.5
    print(a)

Submission status: Accepted

Solution code:
while 1:
    if input() == '0':
        break
    s = list(map(int, input().split()))
    m = sum(s) / len(s)
    m_2 = sum(i ** 2 for i in s) / len(s)
    print('{0:f}'.format((m_2 - m ** 2) ** 0.5))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math

while 1:
    n = int(raw_input())

    if n == 0:
        break

    nums = map(float, raw_input().split(" "))

    m = sum(nums) / float(n)
    std = 0

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

    print(math.sqrt(std / float(n)))

Submission status: Accepted

Solution code:
import math

while True:
    n = input()
    
    if n == "0":
        break
    else:
        score = list(map(float, input().split()))
        m = sum(score)/len(score)
        for i in range(len(score)):
            score[i] = (score[i]-m)**2
    answer = math.sqrt(sum(score)/len(score))
    print(answer)

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0: break
    s = tuple(map(int, input().split()))
    su = sum(s)
    m = sum(s) / n
    print(math.sqrt(sum([(si - m)**2 for si in s])/float(n)))

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:
import math

while True:
    n = input()
    if n == 0:
        break
    m = map(float,raw_input().split())
    print "%5f" %(math.sqrt(sum([(m[i]-(sum(m)/len(m)))**2 for i in range(n)])/n))

Submission status: Accepted

Solution code:
import math

while True:
    n = input()
    if n == 0:
        break
    m = map(float,raw_input().split())
    ave= sum(m)/len(m)

    print "%5f" %(math.sqrt(sum([(m[i]-(ave))**2 for i in range(n)])/n))

Submission status: Accepted

Solution code:
import math
n = 1
while n != 0:
 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 /= n
  si2 = 0
  for i in range(n):
   si2 += (s[i] - m)**2
  si2 /= n
  print(math.sqrt(si2))

Submission status: Accepted

Solution code:
# coding:utf-8
import math

N=int(input())

while N!=0:
    sigma=0
    s=list(map(int,input().split()))

    ave=float(sum(s)/N)

    for i in s:
        sigma=sigma+(i-ave)**2/N

    print('%.6f'%math.sqrt(sigma))
 
    N=int(input())

Submission status: Accepted

Solution code:
import math

while(1):
    a_2 = 0
    n = int(raw_input())
    if n == 0:
        break
    s = map(float, raw_input().split())

    Sum = sum(s)
    m = Sum/n
    
    for i in range(n):
        a_2 += (s[i] - m)**2 
    a_2 = a_2/n
    
    a = math.sqrt(a_2)
    
    print a

Submission status: Accepted

Solution code:
while True:
    number_of_input = int(raw_input())
    if number_of_input == 0:
        break
    values = [float(x) for x in raw_input().split()]
    second_moment = sum([x * x for x in values]) / number_of_input
    first_moment = sum([x for x in values]) / number_of_input
    print(second_moment - first_moment ** 2.0) ** 0.5

Submission status: Accepted

Solution code:
import math

while True:
    number_of_input = int(raw_input())
    if number_of_input == 0:
        break
    values = [float(x) for x in raw_input().split()]
    second_moment = sum([x ** 2.0 for x in values]) / number_of_input
    first_moment = sum([x for x in values]) / number_of_input
    print math.sqrt(second_moment - first_moment ** 2.0)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    from statistics import pstdev

    while True:
        # ??????????????\???
        data_count = int(input())
        if data_count == 0:
            break
        scores = [int(x) for x in input().split(' ')]

        # ?¨??????????????¨????
        result = pstdev(scores)

        # ???????????????
        print('{0:.8f}'.format(result))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import math

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

    m = 0 # ?????????
    m2 = 0 # 2???????????????
    
    s = map(int,input().split())

    for i in s:
        m += i
        m2 += i ** 2

    m /= n
    m2 /= n

    sd = math.sqrt(m2 - m**2)

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

Submission status: Accepted

Solution code:
import math
while True :
  n = int(input())
  if n==0:
    break;
  i = list(map(int, input().split(' ')))
  avg = sum(i)/n
  j = list(map(lambda x: (x-avg)**2, i))
  print("{:.5f}".format(math.sqrt(sum(j)/n)))

Submission status: Accepted

Solution code:
import math
while True:
  n = int(input())
  if n == 0:
    break
  s = [int(_) for _ in input().split()]
  m = sum(s)/n
  a = math.sqrt( sum([pow(_-m, 2) for _ in s])/n )
  print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import statistics
while input() != "0":
    print("{0:.6f}".format(statistics.pstdev(map(float, input().split()))))

Submission status: Accepted

Solution code:
import statistics
while input() != "0":
    data = list(map(float, input().split()))
    print("{0:.6f}".format(statistics.pstdev(data)))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    s = list(map(int, input().split()))
    m = sum(s)/n
    a2 = sum([(s[i] - m)**2 for i in range(n)])/n
    a = a2**0.5
    print(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
    a2 = 0.0
    for i in range(n):
        a2 += (s[i] - m)**2
    a = (a2/n)**0.5
    print(a)

Submission status: Accepted

Solution code:
import statistics as st
while True:
    n = int(input())
    if n == 0:
        break
    x = tuple(map(float, input().strip().split()))
    y = st.mean(x)**2
    z = st.mean(map(pow, x, (2 for i in range(n))))
    print((z-y)**0.5)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    x = tuple(map(float, input().strip().split()))
    y = (sum(x)/n)**2
    z = sum(map(pow, x, (2 for i in range(n))))/n
    print((z-y)**0.5)

Submission status: Accepted

Solution code:
import math

n = []
score = []
scores = []

while True:
    input_n = int(input())
    if input_n == 0:
        break
    n.append(input_n)
    input_score = [int(i) for i in input().split()]
    score.append(input_score)


def total(scorelist):
    total = 0
    for i in range(len(scorelist)):
        total = total + scorelist[i]
    return total


def ave(total,n):
    return float(total / n)

def variance(scorelist,ave,n):
    total = 0
    for i in range(len(scorelist)):
        total = total + math.pow(scorelist[i]-ave,2)
    return total / n

for i in range(len(n)):
    total_score = total(score[i])
    average = ave(total_score,n[i])
    var = variance(score[i],average,n[i])
    print(math.sqrt(var))

Submission status: Accepted

Solution code:
import math
n = int(raw_input())
while(n):
    score = map(int, (raw_input()).split(" "))
    m = sum(score)*1.0/n
    dev = [(s-m)*(s-m) for s in score]
    print math.sqrt(sum(dev)*1.0/n)
    n = int(raw_input())

Submission status: Accepted

Solution code:
import statistics

while(1):
    n = int(input())
    if n == 0:
        exit()

    s = [int(i) for i in input().split()]
    print(statistics.pstdev(s))

Submission status: Accepted

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

    s = list(map(int,input().split()))
    m = 0
    sum = 0
    for i in range(n):
        sum += s[i]
    m = sum/n

    tmp = 0
    for i in range(n):
        tmp += (s[i]-m)**2
    print((tmp/n)**0.5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

while True:
	N = int(input())
	if N == 0:
		break
	
	S = list(map(int, input().split()))
	S2 = [x ** 2 for x in S]
	
	V = sum(S2)/N - (sum(S)/N) ** 2
	print(math.sqrt(V))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import *
while True:
    n = 0
    n = int(input())
    if n == 0:
        break
    else :
        sco = map(int,raw_input().split())
        for i in range(n):
            ave=0.0
            for i in sco:
                ave += i
            ave /= n
            dev = 0.0
            for i in sco:
                dev += (i-ave)*(i-ave)
            dev /= n
        print sqrt(dev)

Submission status: Accepted

Solution code:
import math

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

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

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

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

Submission status: Accepted

Solution code:
from statistics import pstdev

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

Submission status: Accepted

Solution code:
from statistics import pstdev

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import statistics
import sys


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import os
import math


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

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

    print(math.sqrt(variance))

Submission status: Accepted

Solution code:
from statistics import pstdev

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

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

Submission status: Accepted

Solution code:
import statistics as st

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