← Back to Strings
Question 12
First Three Characters
First Three Characters
Read one word and print only its first three characters using the slice [0:3], which starts at position 0 and stops before position 3. Input: one line, a word of at least three characters, no prompt. The output is one line holding those three characters.
Expected Output:
pyt= 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.