标签:ret range logs print col tool def cto 阶乘计算
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
标签:ret range logs print col tool def cto 阶乘计算
原文地址:http://www.cnblogs.com/zhaoxianglong1987/p/7562791.html