input: Write a function to replace a given string with another string in a sentence. The function should take three parameters: the original sentence, the old word to be replaced, and the new word to replace with. The function should return the new sentence after performing the replacement. If the old word does not exist in the sentence, the original sentence should be returned unchanged.
  
  assert replace_string("I love walking on the beach", "walking", "swimming") == "I love swimming on the beach"
  assert replace_string("The cat is sleeping", "cat", "dog") == "The dog is sleeping"
  assert replace_string("Programming is fun", "coding", "programming") == "Programming is fun"
  assert replace_string("", "any", "new") == ""
  assert replace_string("Repeated word word word", "word", "text") == "Repeated text text text"
output: def replace_string(sentence, old_word, new_word):
      if old_word in sentence:
          return sentence.replace(old_word, new_word)
      return sentence