Contact: aviboots(AT)netvision.net.il
39,788 questions
51,694 answers
573 users
def multiply(lst) : result = 1 for i in lst: result = result * i return result lst = [1, 2, 3, 4, 5] print(multiply(lst)) ''' run: 120 '''
import numpy lst = [1, 2, 3, 4, 5] result = numpy.prod(lst) print(result) ''' run: 120 '''