Loading...
Loading...
Loading...
A message arrives with its words in the wrong order. Print the words in reverse order, separated by single spaces. Extra spaces inside the text are ignored.
Example
Input
login failed twice
Output
twice failed login
Words reversed.
Try the problem first. Open one hint at a time.
split() without arguments splits on any amount of white space.
Reverse the list of words and join it with one space.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor