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
n = int(input())
while n != 0:
	s = list(map(float, input().split()))
	m = 0
	for i in range(n):
		m += s[i]
	m /= n
	sd = 0
	for i in range(n):
		sd += (s[i] - m) **2
	sd = math.sqrt(sd / n)
	print('%f' % sd)
	n = int(input())

Solution (Python):
ans = []

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

    s = [int(si) for si in input().split()]
    m = sum(s) / n
    a2 = sum([(si - m) ** 2 for si in s]) / n
    ans += [a2 ** 0.5]

print("\n".join(map(lambda x: "%.5f" % x, ans)))

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

Solution (Python):
while(1):
    n = int(input())
    if n == 0:
        break
    s = [float(i) for i in input().split()]
    m = sum(s)/n
    a = (sum([(i- m)**2 for i in s])/n)**0.5
    print("{:.8f}".format(a))

Solution (Python):
import math

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

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

Solution (Python):




import math

while 1:
    n = int(input())
    if n == 0:
        break
    a = list(map(int,input().split()))
    ave = sum(a)/len(a)

    ans = 0
    for i in range(n):
        ans += (a[i]-ave)**2
    ans /= n

    print("%.10f"%math.sqrt(ans))

Solution (Python):
import sys
import statistics

while True:
    n = sys.stdin.readline().strip()
    if n == '0':
        break

    data = list(map(int, sys.stdin.readline().strip().split()))
    print('{0:.8f}'.format(statistics.pstdev(data)))

Solution (Python):
import math
anslst = []
while True:
    n = int(input())
    if n == 0:
        break
    else:
        
        l = []
        x = 0
        l = list(map(float, input().split()))
        ave = sum(l)/n 
        for i in range(n):
            x += (l[i] - ave) ** 2
        anslst.append(math.sqrt(x / n))
for i in anslst:
    print('{0:.8f}'.format(i))

Solution (Python):
import math  
n = int(input())
while n!= 0 :
    li = list(map(int,input().split()))
    m = sum(li)/n
    s = 0
    for i in li:
        s += (i-m)**2
        
    a = math.sqrt(s/n)
    print(a)
    n = int(input())

Solution (Python):
from statistics import pstdev

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

    s = list(map(float, input().split()))
    print(pstdev(s))

Solution (Python):
import math
while True:
    n = int(input())
    if n == 0:
        break
    arr = list(map(int, input().split()))
    m = sum(arr) / n
    acum = 0
    for x in arr:
        acum += pow(x-m, 2)
    print(f'{math.sqrt(acum/n)}')

Solution (Python):
import math
def main():
	while True:
		n = int(input())
		if n == 0:
			break
		l = list(map(int, input().split()))
		m = sum(l)/n
		k = []
		for a in l:
			k.append((a- m)**2)
		a = math.sqrt(sum(k)/n)
		print(a)

main()

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

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

    a_2 = sum([(x - m) ** 2 for x in s]) / n
    print(a_2 ** 0.5)

Solution (Python):
import math
n=int(input())
hyoujunhensa=[]

while n!=0:
    tokuten=list(map(int,input().split()))

    average=sum(tokuten)/n
    a2=0

    for i in range(n):
        a2=a2+pow(tokuten[i]-average,2)
    a2=math.sqrt(a2/n)
    hyoujunhensa.append(a2)
    n=int(input())

for j in range(len(hyoujunhensa)):
    print(hyoujunhensa[j])

Solution (Python):

from functools import reduce
import math

while True:
    n = int(input())
    if ( n == 0 ):
        break
    l  =  list(map(int,input().split()))
    mean = float(reduce(lambda a,b:a+b,l)) / (len(l))
    t = 0
    for i in l:
        t += pow((i - mean),2)
    bunsan = float(t) / len(l)
    print (math.sqrt(bunsan))

Solution (Python):
import math,sys
for i in range(sys.maxsize):
    n=int(input())
    if n ==0:
        break
    else:
        l=list(map(int,input().split()))
        m=sum(l)/n
        x=0
        for j in range(n):
            x+=(l[j]-m)**2
        a=math.sqrt(x/n)
        print(a)

Solution (Python):
from statistics import pstdev
while input()!="0":
    lst=map(int,input().split())
    print(pstdev(lst))

Solution (Python):
from statistics import mean
import math

anslist = []

while(1):

    n = int(input())
    if n == 0:
        break
    elif n == 1:
        l = int(input())
        anslist.append(0)
    else:
        l = list(map(int, input().split()))
        ave = mean(l)
        sum = 0
        for s in l:
            sum += (s - ave)**2
        var = sum / n
        ans = math.sqrt(var)
        anslist.append(ans)

for ans in anslist:
    print(ans)

Solution (Python):
def get_avg(num_list):
    return sum(num_list) / len(num_list)

def calculate_deviation(num_list,avg):
    diff_list = []
    for num in num_list:
        diff_list.append(num-avg)
    return diff_list

def calculate_variance(num_list):
    total = 0
    for num in num_list:
        total += num**2
    return total/len(num_list)

def calculate_stdev(variance):
    return variance ** 0.5

while True:
    n = int(input())
    if n == 0:
        break
    else:
        data_set= list(map(float,input().split()))
        avg = get_avg(data_set)
        dev_list = calculate_deviation(data_set,avg)
        vrnc = calculate_variance(dev_list)
        print(calculate_stdev(vrnc))

Solution (Python):
import math
while True:
	n=int(input())
	if n==0:
		break
	else:
		s=list(map(float,input().split()))
		sum=0
		hen=0
		for i in s:
			sum+=(i/n)			
		for i in s:
			hen+=((i-sum)**2)/n
		print(round(math.sqrt(hen),8))

Solution (Python):
from statistics import variance
import math
while(1):
    n=int(input())
    if(n==0):
        break
    elif(n==1):
        data=list(map(int,input().split()))
        print(0)
    else:
      data=list(map(int,input().split()))
      print(math.sqrt(variance(data) *(n-1) /n))

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

Solution (Python):
def calculate_mean(data):
    s = sum(data)
    N = len(data)
    mean =s/N

    return mean


def find_difference(data):
    mean = calculate_mean(data)
    diff = []

    for num in data:
        diff.append(num-mean)
    return diff

def calculate_variance(data):
    diff = find_difference(data)
    
    squared_diff = []
    for d in diff:
        squared_diff.append(d**2)

    
    sum_squared_diff = sum(squared_diff)
    variance = sum_squared_diff/len(data)
    return variance

while True:
    n = int(input())
    if n==0:
        break
    data = list(map(int, input().split()))
    
    variance = calculate_variance(data)
    

    std = variance**0.5
    
    print('{}'.format(std))

Solution (Python):
import math
while True:
    n = int(input())
    if n==0: break
    a = []
    aa = []
    for k in list(map(int, input().split())):
        a.append(k)
        aa.append(k*k)
    print(math.sqrt(sum(aa)/n-(sum(a)/n)**2))

Solution (Python):
from math import sqrt

result = []
while True:
    n = int(input())
    if (n == 0):
        break
    num = input().split()
    total = 0
    for i in num:
        total += int(i)
    average = total / n
    v = 0
    for i in num:
        v += (int(i) - average) ** 2
    result.append(sqrt(v / n))

for i in result:
    print(i)

Solution (Python):
while True:
    n = int(input())
    if n == 0:
        break
    Scr = list(map(int, input().split()))
    ScrSq = []

    for i in Scr:
        ScrSq.append(i**2)

    print((sum(ScrSq)/n - (sum(Scr)/n)**2)**(1/2.0))

Solution (Python):
import math

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

Solution (Python):
import math
while True:
    n = int(input())
    if n == 0:
        break
    num = list(map(int, input().split()))
    avg = sum(num) / n
    tmp = 0
    for i in num:
        tmp+=(i-avg)**2
    print(math.sqrt(tmp/n))

Solution (Python):
import math

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

Solution (Python):
while int(input()):
    score = list(map(int, input().split()))
    M = sum(score) / len(score)
    SD = (sum([(n - M) ** 2 for n in score]) / len(score)) ** 0.5
    print("{:.4f}".format(SD))

Solution (Python):
import math

while True:
    n = float(input())
    if n == 0: break
    student = list(map(float, input().split()))
    average = sum(student) / n
    deviation = [(point-average)**2  for point in student]
    dispersion = sum(deviation) / n
    sqrt = math.sqrt(dispersion)
    print(sqrt)

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

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

    print("{0:.8f}".format(a))

Solution (Python):
import math

while True:
    student_num = int(input())
    if student_num == 0:
        exit()
    
    points = list(map(int, input().split()))
    ave = sum([point for point in points]) / student_num
    sigma = sum([(num - ave) ** 2 for num in points]) / student_num
    alpha = math.sqrt(sigma)
    print(alpha)

Solution (Python):
while True:
	n = int(input())
	if n <= 0:
		break
	s = [int(x) for x in input().split()]
	m = sum(s) / n
	s = [(x - m) ** 2 for x in s]
	print('%.8f' % ((sum(s) / n) ** 0.5))

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

Solution (Python):
import math
n = int(input())
while not n == 0:
	ss = [float(i) for i in input().split(' ')]
	m = sum(ss)/n
	a2 = sum([(i-m)**2 for i in ss]) / n
	print(math.sqrt(a2))
	n = int(input())

Solution (Python):
import math
data = []
tmp = []
output = []
for x in range(0,10000):
    num = int(input())
    if num == 0:
        break
    else:
        tmp = input().split()
        data.append([float(tmp[i]) for i in range(num)])
        avg = sum(data[0])/num
        output.append(math.sqrt(sum(pow( data[0][i] - avg  ,2) for i in range(num))/num ))
        data.clear()
for x in range(len(output)):
    print(output[x])