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

  The standard deviation of the scores is the square root of their variance. Input The input consists of multiple datasets. Each dataset is given in the following format:  n  s 1  s 2 ... s n  The input ends with single zero for n . Output For each dataset, print the standard deviation in a line. The output should not contain an absolute error greater than 10 -4 . Constraints  n ≤ 1000  0 ≤ s i ≤ 100  Sample Input 5
70 80 100 90 20
3
80 80 80
0 Sample Output 27.85677655
0.00000000

Solution (Python):
import math
def main():

    while True:
        n = int(input())
        if n == 0:
            break
        else:
            data = list(map(float, input().split()))
            avg = sum(data) / n
            square = 0
            for i in range(n):
                square += data[i]**2
            print(math.sqrt((square / n - avg**2)))
            
if __name__ == '__main__':
    main()

Solution (Python):
while True:
    n=int(input())
    if n==0:break
    s=list(map(float,input().split()))
    print((sum(map(lambda x: x*x,s))/n-(sum(s)/n)**2)**.5)

Solution (Python):
from statistics import pstdev


def main():
    while int(input()) != 0:
        scores = map(float, input().split())
        print('{:.5f}'.format(pstdev(scores)))


if __name__ == '__main__':
    main()

Solution (Python):
from math import sqrt

def sd(nums):
    n   = len(nums)
    ave = sum(nums)/n

    return abs(sqrt(sum([(s - ave)**2 for s in nums])/n))

def main():
    while True:
        n = input()

        if n == '0':
            break

        nums = [int(x) for x in input().split()]
        print("{:f}".format(sd(nums)))

if __name__ == '__main__':
    main()

Solution (Python):
import math
while True:
    n = int(input())
    if n == 0: break
    s = list(map(int,input().split()))
    dis = 0
    mean = sum(s)
    mean /= n
    for s in s:
        dis += (s-mean)**2
    print('{0:.5f}'.format(math.sqrt(dis/n)))

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

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

Solution (Python):
import math

daviations = []

while True:
    
    num = int(input())

    if num == 0:
        break
    
    scores = input().split()
    
    for i in range(num):
        scores[i] = float(scores[i])

    avr = sum(scores) / num
    
    daviation = 0
    
    for a in scores:
        disp = (a - avr)**2/num
        daviation += disp
        
        
        
    daviations.append(round(math.sqrt(daviation),8))
    
for b in daviations:
        print(b)

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

Solution (Python):
from sys import stdin
from math import sin, cos, pi, sqrt

while True:
    n = int(stdin.readline().rstrip())
    if n == 0:
        break
    else:
        s = [int(x) for x in stdin.readline().rstrip().split()]
        ava = sum(s)/n
        alpha = sqrt(sum([(si-ava)**2 for si in s])/n)
        print(alpha)

Solution (Python):
import math














while True:
    n = int(input())
    if n == 0:
        break
    data = [int(i) for i in input().split()]
    mean = sum(data) / n
    tmp = 0
    for i in data:
        tmp += (i - mean)**2
    print('%f' % (math.sqrt(tmp / n)))

Solution (Python):
import statistics
while True:
	if int(input()) == 0: break
	print('%.8f' % statistics.pstdev(list(map(int, input().split()))))

Solution (Python):



import math

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

Solution (Python):


if __name__ == '__main__':
    while True:
        n = int(raw_input())
        if n == 0:
            break

        s = map(float, raw_input().split())
        m = sum(s)/len(s)
        print (sum(map(lambda x : (x-m)**2, s))/len(s))**0.5

Solution (Python):



import statistics

while 1:
    n = int(input())
    if n == 0 :
        break
    data = map(int, input().split())
    """
    statistics.m = mean(data)
    statistics.median = median(data)
    statistics.variance = variance(data)
    """
    std = float(statistics.pstdev(data))
    
    print(std)

Solution (Python):
import statistics

while True:
	a=int(input())
	num=[]
	if a==0:
		break
	else:
		num=list(map(int,input().split()))
	print(statistics.pstdev(num))

Solution (Python):
from math import sqrt
while 1:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    av = sum(a)/len(a)
    Sum = sum((x-av)**2 for x in a)
    print(f'{sqrt(Sum/n):.8f}')

Solution (Python):

import statistics as st

while True:
    N = int(input())
    if N == 0:
        break
    buf = list(map(float, input().split()))
    sd = st.pstdev(buf)
    print("%.8f"%sd)

Solution (Python):
from statistics import pstdev, variance, mean
while 1:
    num = int(input())
    if num == 0:
        break
    else:
        data = list(map(int, input().split()))
        st = float(pstdev(data))
        print(st)

Solution (Python):
from math import *
while True:
    n = int(input())
    if(n == 0 ): break
    data = list(map(int,input().split()))  
    a = sum(data) / n
    b = 0
    c = 0
    for i in data:
        b += pow(i-a,2)
    c = sqrt(b/n)
    
    print(c)

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

Solution (Python):
import math
while True:
    n = input()
    if(n == 0):
        break
    s = map(int, raw_input().split())
    average = 0.0
    for i in s:
        average += i
    average /= len(s)
    alpha_pow = 0.0
    for i in range(len(s)):
        alpha_pow += (s[i] - average) * (s[i] - average)
    alpha_pow /= n
    print(math.sqrt(alpha_pow))

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

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

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

Solution (Python):
import math


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

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

Solution (Python):
import math

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

	a2 = sum([math.pow(x-average, 2.0) for x in nums]) / n
	print math.sqrt(a2)

Solution (Python):
import math
while True:
    count = int(input())
    if count == 0:
        break

    data = [int(i) for i in input().split()]
    m = sum(data) / len(data)
    a = sum([(x - m) ** 2 for x in data]) / count

    print('{0:.5f}'.format(math.sqrt(a)))

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

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

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

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

Solution (Python):


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

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

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

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

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

Solution (Python):

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

Solution (Python):

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):


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)

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

Solution (Python):


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)

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

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

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

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

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

Solution (Python):
import math

while 1:

    
    n = input()
    if n == 0:
        break
    
    s = map(float, raw_input().split())
    
    ave = 0
    for i in s:
        ave += i
    ave = ave / len(s)
    
    alpha = 0
    for i in s:
        alpha += (i - ave)*(i - ave)
    alpha = math.sqrt( alpha/len(s) )
    
    print alpha

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

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

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

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

Solution (Python):

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

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

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

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

Solution (Python):


import math

ans = []

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

Solution (Python):
import math

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)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):

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

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

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

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

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

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

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

Solution (Python):

import math

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

    m = 0 
    m2 = 0 
    
    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))

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import statistics

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

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

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

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

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

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

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

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

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

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