Add all the A tasks
This commit is contained in:
parent
2dd7375f96
commit
051504d65b
1608 changed files with 18584 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
from math import fsum
|
||||
def average(x):
|
||||
return fsum(x)/float(len(x)) if x else 0
|
||||
print (average([0,0,3,1,4,1,5,9,0,0]))
|
||||
print (average([1e20,-1e-20,3,1,4,1,5,9,-1e20,1e-20]))
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
2.3
|
||||
2.3
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
def average(x):
|
||||
return sum(x)/float(len(x)) if x else 0
|
||||
print (average([0,0,3,1,4,1,5,9,0,0]))
|
||||
print (average([1e20,-1e-20,3,1,4,1,5,9,-1e20,1e-20]))
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
2.3
|
||||
1e-21
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
def avg(data):
|
||||
if len(data)==0:
|
||||
return 0
|
||||
else:
|
||||
return sum(data)/float(len(data))
|
||||
print avg([0,0,3,1,4,1,5,9,0,0])
|
||||
|
|
@ -0,0 +1 @@
|
|||
2.3
|
||||
Loading…
Add table
Add a link
Reference in a new issue