def fact(a,b): return a*b from functools import reduce print(reduce(fact,range(1,6)))
from functools import reduce print(reduce(lambda x, y: x * y, range(1, 6)))
输出:
120