For8. Two integers A and B (A < B) are given. Find the product of all integers from A to B inclusive.

Solution Python 3:

import random

A = random.randrange(10)
n = random.randrange(10)+1
B = A + n
print('A = ', A)
print('B = ', B)

P = 1
for i in range(A,B+1,1):
P *= i
print(i," : ",P)
print("Product = ",P)