Given a string of words, reverse all the words. For example:
Given:
'This is the best'
Return:
'best the is This'
As part of this exercise you should remove all leading and trailing whitespace. So that inputs such as:
' space here'
and
'space here '
both become:
'here space'
Create your solution in the form:
def rev_word(s: str) -> str:
pass
>>> rev_word('Hi John, are you ready to go?')
'go? to ready you are John, Hi'
>>> rev_word(' space before')
'before space'