1234321 how to print in one line in python code example
Example: 1 121 12321 triangle in python
row = int(input('Enter how many lines? '))
# Generating pattern
for i in range(1,row+1):
# for space
for j in range(1, row+1-i):
print(' ', end='')
# for increasing pattern
for j in range(1,i+1):
print(j, end='')
# for decreasing pattern
for j in range(i-1,0,-1):
print(j, end='')
# Moving to next line
print()