#use (variable name).replace('something', 'smth') #Example: str = "codegrapper" str.replace('grapper', 'grepper') print(str) #output: codegrepper