string = "I love Java" new_string = string.replace("Java", "Python") print(new_string) # I love Python