从0加到100
from functools import reduce
def func (x,y):
return x+y
print(reduce(func,range(101)))
print(reduce(lambda x, y: x+y, range(101)))
from functools import reduce
def func (x,y):
return x+y
print(reduce(func,range(101)))
print(reduce(lambda x, y: x+y, range(101)))