Contact: aviboots(AT)netvision.net.il
39,907 questions
51,839 answers
573 users
def rreplace_word(s, old, new): lst = s.rsplit(old, 1) return new.join(lst) s = 'python c c++ python java python c c#' s = rreplace_word(s, 'python', 'php') print(s) ''' run: python c c++ python java php c c# '''