Skip to content

The last letter

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.

Log in or create account

IGCSE, A-Level & AP