用Python写一个计算100阶乘的代码
时间: 2023-05-23 16:04:45 浏览: 191
python计算n的阶乘的方法代码
5星 · 资源好评率100%
答:
```python
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n-1)
result = factorial(100)
print(result)
```
结果:
```
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
```
阅读全文