Well, I was wondering why number 2 is not the first one to be printed in this script, I'm not understanding logic.
altura = 5
linha = 1
while linha <= altura:
print ('1', end = '')
coluna = 2
while coluna < altura:
if linha == 1 or linha == altura:
print ('2')
else:
print(end = '')
coluna = coluna + 1
print ('3')
linha = linha + 1