Computer Science, asked by anakhakumar21, 4 months ago

write a python program to read N element into a list and print the product at element
its very important !!!!!

Answers

Answered by himanshu2006vps
3

Answer:

# Python program to multiply all values in the

# list using traversal

def multiplyList(myList) :

# Multiply elements one by one

result = 1

for x in myList:

result = result * x

return result

# Driver code

list1 = []

n = int(input("Enter number of elements : "))

for i in range(0, n):

ele = int(input())

list1.append(ele) # adding the element

print(multiplyList(list1))

Similar questions