For29. An integer N (> 1) and two real points on the numerical axis: A, B (A < B) are given. The segment [A, B] is divided into N equal segments. Output H - the length of each segment, as well as a set of points forming a partitioning of the interval [A, B]:
\(A, A + H, A + 2 \cdot H, A + 3 \cdot H, ... , B,\).

Solution in Python 3:

import random

B = random.randrange(-9,11)
A = random.randrange(-10,B)
N = random.randrange(2,11)

H = (B - A) / N
print("A = ",A)
print("B = ",B)
print("N = ",N)
print("H = ",H)

x = A
for i in range(0,N):
print(x,end=", ")
x += H
print(x)