Advertisement
ganiyuisholaafeez

Strip and replace functions

Feb 11th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. def fancy_cleanup(string):
  2.     cleanup = string.strip().replace("g", "z").replace(" ", "!")
  3.     return cleanup
  4. print(fancy_cleanup("         geronimo crikey          "))
  5. print(fancy_cleanup("         nonensense     "))
  6. print(fancy_cleanup("grade"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement