1row = int(input('Enter how many lines? '))
2
3# Generating pattern
4for i in range(1,row+1):
5
6 # for space
7 for j in range(1, row+1-i):
8 print(' ', end='')
9
10 # for increasing pattern
11 for j in range(1,i+1):
12 print(j, end='')
13
14 # for decreasing pattern
15 for j in range(i-1,0,-1):
16 print(j, end='')
17
18 # Moving to next line
19 print()