You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
from math import *
|
|
|
|
s = [float(x) for x in '176 176 176 176 175'.split('\t')]
|
|
|
|
|
|
def avg(list_):
|
|
m = 0
|
|
ms = 0
|
|
for v in list_:
|
|
m += v
|
|
ms += v ** 2
|
|
n = len(list_)
|
|
|
|
m /= n
|
|
ms /= n
|
|
return (m, ((ms - m ** 2) / (n * (n - 1))) ** 0.5)
|
|
|
|
print(avg(s)) |