← Back to Strings
Question 10
Last Letter With A Negative Index
Last Letter With A Negative Index
Read one word and print its last character alone on a line. Input: one line, the word, no prompt. A negative position counts from the end of the string, and -1 is the last character, so no len() call is needed.
Expected Output:
n= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Strings
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.