gpt4 book ai didi

python - 列表python的产品

转载 作者:行者123 更新时间:2023-11-28 19:33:33 27 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Returning the product of a list

除了这种方式,还有其他方法可以获取列表的产品吗:

def prod(L):
p=1
for i in L:
p= i * p
return p

这段代码是正确的,但我需要找到另一种方法来做到这一点。我真的找不到它。

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com