Advertisement
Fhernd

buscar-reemplazar.py

Apr 12th, 2018
2,216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. import re
  2.  
  3. python = "Python es un lenguaje de programación compilado"
  4.  
  5. print (python.replace('compilado', 'interpretado'))
  6.  
  7. evento = "Hoy es 12/04/2017. Fin recetas Python 13/01/2018"
  8.  
  9. print(re.sub(r'(\d+)/(\d+)/(\d+)', r'\3-\1-\2', evento))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement