I want to print this pattern:
1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321
12345678910987654321
My program for this:
n=11
for i in range(1,n):
for j in range(1,n-i):
print(end=' ')
for j in range(1,i+1):
print(j,end='')
for j in range(1,i-1):
print(j,end='')
print()
But this program is not printing the desired pattern. Instead it is printing:
1
12
1231
123412
12345123
1234561234
123456712345
12345678123456
1234567891234567
1234567891012345678
Where am I going wrong? Please do help.Thanks in advance.