发布网友 发布时间:2022-04-23 12:06
共1个回答
热心网友 时间:2022-04-06 11:23
# many solutions for it, here is one.
def avg(x):
global size
return x / size * 1.
seq = [i for i in xrange(120)]
size = 12
for slist in [seq[i:i+size] for i in range(0, len(seq), size)]:
print map(avg, [rece(lambda x, y: x+y, slist)])