how to replace a part of a string python 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