python replace a substring in a string code example
Example: python replace substring
txt = "I like bananas"
x = txt.replace("bananas", "apples")
print(x) # ----> I like apples
txt = "I like bananas"
x = txt.replace("bananas", "apples")
print(x) # ----> I like apples