代码如下: def func(n): if n == 1: return 1 else: ret = n * func(n-1) return ret result = func(10) # 10! print(result)