n=int(input()) answer=[[1]] for i in range(2, n+1): t=[i]*((2*i)-3) answer.insert(0, t) answer.append(t) for a in answ
Using
for i in range(2*n-1): print() for j in range(len(answerfinal[i])): print(answerfinal[i][j], end='')
instead of
for a in answerfinal: print(a)
might help.