PythiloEasy · 12 min · Task 33 of 100 · progress kept in this browser

Reverse whitespace-delimited words

Return the words of text in reverse order, joined by one space. Discard leading, trailing and repeated whitespace.

words = ' a\tb c '.split()
print(words[::-1])
Your task

Return the words of text in reverse order, joined by one space. Discard leading, trailing and repeated whitespace.