import random x = [random.randint(1000, 1010) for p in range(0, 20)] j = 0 for i in x: j += 1 print(i, end=' ') if j == 4: j = 0 print() pass