Skip to content
Snippets Groups Projects
Commit 53f6aafe authored by KimTaeeun's avatar KimTaeeun
Browse files

Upload New File

parent 6d990329
No related branches found
No related tags found
No related merge requests found
import math
def stddev(*args):
def mean():
return sum(args) / len(args)
def variance(m):
total = 0
for arg in args:
total += (arg - m) ** 2
return total / (len(args)-1)
v = variance(mean())
return math.sqrt(v)
print(stddev(2.3, 1.7, 1.4, 0.7, 1.9))
print(stddev(1,2,3))
# print(stddev(1))
# ZeroDivisionError
# print(mean(1,2))
# NotDefined
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment