Guest User

Untitled

a guest
Dec 26th, 2021
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. def replace_fn(word,old,new):
  2.     if word[-len(old):] == old:
  3.         new_word = word[:-len(old)]+new
  4.         return new_word
  5.     return word
  6.  
Advertisement
Add Comment
Please, Sign In to add comment