收起
python没有自带阶乘的功能,只能调用库或者使用循环
def num(n): if n == 0: return 1 else: return n * num(n - 1)
import math value = math.factorial(6) print(value)
报告相同问题?