def rotate(n,xs):
return xs[len(xs)-n:]+ xs[0:len(xs)-n]
rotate(4,[1,2,3,4,5,6])
rotate(6,xs = [1,2,3,4,5,6,7,8,9,10])
def chisqr(os,es):
result = 0.0
for i in range(len(os)):
result = result + (os[i]-es[i])**2/es[i]
return result
os = [2]*26 [2,2,2,2,...]
es = [1]*26 [1,1,1,1]
chisqr(os,es)
def chisqr_statistic(os,es):
result = []
for n in range(26):
???
return result
min([4,3,5,6,1])
[4,3,5,6,1].index(5)
result = [ (2,'Red'), (3,'Blue'), (1,'Green') ]
result.sort()
print(result)
xs = []
for i in range(10):
xs.append(i)
print(len(xs))