Basic Programs

If Else Programs

While loop Programs

For loop Programs

List Programs


Python Program to Multiply numbers in the List


This example shows, how to multiply all numbers in the list. We will take the list as input from the user.And then multiply all values to a product variable. At the end return the product. And return the value of all numbers of the list.

Example.py
a = []
limit = int(input("Enter number of elements: "))
for i in range(0, limit):
    sum = int(input())
    a.append(sum)

value = 1
for i in a:
    value *= i

print("List : ", a)
print("Product of all values = ", value)

Output

Enter number of elements: 5
98
68
7
9
2
List :  [98, 68, 7, 9, 2]
Product of all values =  839664

Prev Next