write a python program to multiplies all the items in a list

Solutions on MaxInterview for write a python program to multiplies all the items in a list by the best coders in the world

showing results for - "write a python program to multiplies all the items in a list "
Brad
11 Jul 2017
1def list_number_multiplier(list_of_numbers):
2    result = 1
3    for item in list_of_numbers:
4        result = result * item
5    return result
6x = [2,5,8]
7print(list_number_multiplier(x))
Sara
17 Sep 2020
1l = [1,2,3,4,5]
2
3tot = 1
4for x in l:
5  tot = tot * x
6  
7print(tot)
8>>> 120