Skip to content
Home » Python program to compute product of list elements

Python program to compute product of list elements

Below is the Python program to display product of list elements

# product of list elements
lst=list(eval(input("Enter list elements:")))
product=1
for i in range(len(lst)):
product*=lst[i]
print("Product of list elements:",product)

Output:

Enter list elements:3,5,6,1,7,8
Product of list elements: 5040