The last letter · A última letra
The last letter
word is "python". Store its last character in last, without counting the letters yourself.
A negative position counts from the end: word[-1] is the last character, word[-2] the one before it. It works whatever the length.
A última letra
word é "python". Armazene seu caractere final em last, sem contar as letras manualmente.
Uma posição negativa conta do final: word[-1] é o último caractere, word[-2] o anterior. Funciona independente do comprimento.
word is "python". Store its last character in last, without counting the letters yourself. · word é "python". Armazene seu caractere final em last, sem contar as letras manualmente.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.