我试图将列表中的所有数字彼此相乘
a = [2,3,4] for number in a: total = 1 total *= number return total
输出应该是 24,但由于某种原因我得到 4。为什么会这样?
python math list multiplication operator-keyword
list ×1
math ×1
multiplication ×1
operator-keyword ×1
python ×1