Advertisement
Peaser

replacement concept

Oct 4th, 2015
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. replacers = [
  2. ("test", "wow"),
  3. ("ayy", "lmao"),
  4. ("replace","withthis"),
  5. ("20", "40")
  6. ]
  7.  
  8. string = "test ayy replace 20"
  9.  
  10. for i in replacers: string = string.replace(*i)
  11.  
  12. #>>> string
  13. #'wow lmao withthis 40'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement