The first line of input is an integer
In the example, the given starting number is
10, and the number of rows in the pyramid is 5.So, the output should be
10
11 12
13 14 15
16 17 18 19
20 21 22 23 24
n = int(input())
k = int(input())
for r in range(k):
print(*[n + i for i in range(r + 1)])
n += r + 1
Comments
Leave a comment