Loading...
Loading...
Loading...
A puzzle page writes every word backwards but keeps the words in their original order.
Read one line and print it with each word reversed. Words are separated by one or more spaces; print the result with single spaces.
Example
Input
hello world
Output
olleh dlrow
Try the problem first. Open one hint at a time.
Split into words, reverse each word with a slice, and collect them in a list.
Join the list back with a single space.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor