For2. Two integers A and B (A < B) are given. Output in ascending order all integers between A and B (including the numbers A and B themselves), as well as the number N of these numbers.

Solution in Python 3:

import random

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

N = 0
for i in range(A,B+1,1):
N +=1
print(i," : ",N)
print("N = ",N)