def multiplyList(myList):
result = 1
for x in myList:
result = result * x
return result
import numpy
list1 = [1, 2, 3]
result1 = numpy.prod(list1)
print(result1)
lambda w/ numpy.array
from functools import reduce
list1 = [1, 2, 3]
result1 = reduce((lambda x,y : x*y), list1)
print(result1)
math.prod
import math
list1 = [1, 2, 3]
result1 = math.prod(list1)
print(result1)
mul() function from operator
from operator import *
list1 = [1, 2, 3]
m = 1
for i in list1:
m = mul(i,m)
print(m)
참고 : https://www.geeksforgeeks.org/python-multiply-numbers-list-3-different-ways/