Product of Numbers from M to N
Given two integers
The first line of input is an integer
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.
n = int(input("Enter M "))
m = int(input("Enter N "))
mult = 1
for row in range(n, m + 1):
mult *= row
print(mult)
Comments
Leave a comment