Advertisement
skip420

reverse_words

Feb 11th, 2021
1,054
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. #python reverse_words.py
  2.  
  3. import re
  4.  
  5. print re.sub(r'(\w+) (\w+) (\w+)', r'\3 \1 \2',"hey you man")
  6.  
  7.  
  8.  
  9. #then turns that sentence to..
  10. #skip420@skip:~/Desktop$ python reverse.py
  11. man hey you
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement