← Back to Strings
Question 41
Trim The Ends
Trim The Ends
Read one word and print it without its first and last characters, using one slice that starts at 1 and stops before the last character, which is position -1 ([1:-1]). Input: one line, a word of at least two characters, no prompt. The output is one line.
Expected Output:
note= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
StringsSlicing
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.