Answer to Question #219371 in Python for chandu

Question #219371

Product of Numbers from M to N

Given two integers

M, N. Write a program to print the product of numbers in the range M and N (inclusive of M and N).Input

The first line of input is an integer

M. The second line of input is an integer N.Explanation

In the given example, the product of numbers between the range

2 and 5 is 2 * 3 * 4 * 5. Therefore, the output should be 120.


1
Expert's answer
2021-07-21T16:30:51-0400
n = int(input("Enter M    "))
m = int(input("Enter N    "))
mult  = 1
for row in range(n, m + 1):
    mult *=    row
print(mult)
    

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