Answer to Question #322499 in Python for Venkatesh Reddy

Question #322499

given an integer N write program which reads N inputs and prints the product of the given integers

2 3 7


1
Expert's answer
2022-04-02T09:59:28-0400

The following set of codes work efficiently:

# product of n integers
N = int(input("Enter a positive integer: "))
integers = []
for i in range(N):
    num = int(input("Enter integer {}: ".format(i+1)))
    integers.append(num)

# product
product = 1
for integer in integers:
    product *= integer

print("Product is", product)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS