python阶乘 2023-03-28 13:16:57 def factorial(n): if n==0: return 1 else: recurse=factorial(n-1) result=n*recurse return result def fact(n): s=1 for i in range(1,n+1): s*=i return s