Posted By

silviud on 05/06/11


Tagged

python String reverse


Versions (?)

reverse phrase


 / Published in: Python
 

reverts a phrase by words(tokens)

  1. def rev(s):
  2. return ' '.join(reversed(s.split()))
  3.  
  4.  
  5. rev('hello word')
  6. 'word hello'

Report this snippet  

You need to login to post a comment.