Python String Replace

Python String replace() Method Example Replace the word “bananas”: txt = “I like bananas” x = txt.replace(“bananas”, “apples”) print(x) Definition and Usage The replace() method replaces a specified phrase with another…