Product of the Given Numbers
Given an integer using WHILE LOOP
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('N = '))
res = 1
k = 0
while k < n:
res *= int(input())
k += 1
print(res)
Comments
Leave a comment