Answers for "python program to multiplies all the items in a list using function"

1

python program to multiplies all the items in a list using function

def list_number_multiplier(list_of_numbers):
    result = 1
    for item in list_of_numbers:
        result = result * item
    return result
x = [2,5,8]
print(list_number_multiplier(x))
Posted by: Guest on July-27-2021
-2

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

l = [1,2,3,4,5]

tot = 1
for x in l:
  tot = tot * x
  
print(tot)
>>> 120
Posted by: Guest on June-10-2021

Code answers related to "python program to multiplies all the items in a list using function"

Python Answers by Framework

Browse Popular Code Answers by Language