.编写函数,计算20*19*18*…*3的结果
时间: 2023-12-21 14:05:02 浏览: 66
python中如何进行连乘计算
```python
def lazy_product(*args):
def product():
result = 1
for arg in args:
result *= arg
return result
return product
f = lazy_product(20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3)
print(f()) # 输出:121645100408832000
```
阅读全文