Strings and text · Python exercise
Read a line of text and print its characters in reverse order, including spaces.
Read one line of text and print it backwards. Spaces are characters and must be reversed too.
Example 1
Input
hello
Output
olleh
Example 2
Input
a b
Output
b a
How testing works
Your code runs once per test case with that case's standard input. Output is compared after normalising trailing spaces and blank lines at the end. Use input() without a prompt when the exercise expects clean output.
Loading editor…
Press Run tests to execute your code against every input case. Python runs in a Web Worker in your browser.