Given an integer
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
start = int(input())
for k in range(int(input())):
print(*[start + i for i in range(k + 1)])
start += k + 1
Comments
Leave a comment