Product of the Given Numbers
Given an integer
The first line of input is a positive integer,
The output should be the product of the given input integers.
In the given example,
N = 3 and the input integers are 2, 3, and 7.So, the output should be 2 x 3 x 7 = 42
N = int(input("Please enter positive integer: "))
ints = []
for i in range (N):
n = int(input("Enter integer {}: ".format(i+1)))
ints.append(n)
#products
product = 1
for item in ints:
product = product*item
print("Output is ", product)
Comments
Leave a comment