/ Published in: Python
reverts a phrase by words(tokens)
Expand |
Embed | Plain Text
def rev(s): return ' '.join(reversed(s.split())) rev('hello word') 'word hello'
You need to login to post a comment.
reverts a phrase by words(tokens)
def rev(s): return ' '.join(reversed(s.split())) rev('hello word') 'word hello'
You need to login to post a comment.