← Back to Strings
Question 37
Odd Positions
Odd Positions
Read one word and print the characters at the odd positions 1, 3, 5 and so on, using a slice that starts at 1 with an empty stop and a step of 2 ([1::2]). Input: one line, the word, no prompt. The output is one line.
Expected Output:
yhn= 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.