input: Write a function to replace a given word in a string with another word and return the new string. The function should take three parameters: the original sentence, the word to be replaced, and the new word. If the original word is not found in the sentence, return the original sentence unchanged.
  assert replace_word("I love walking on the beach", "walking", "swimming")=="I love swimming on the beach"
  assert replace_word("Cats are cute", "dogs", "animals")=="Cats are cute"
  assert replace_word("The quick brown fox", "fox", "bear")=="The quick brown bear"
  assert replace_word("", "something", "anything")==""
  assert replace_word("Hello world", "world", "")=="Hello "
output: def replace_word(sentence, old_word, new_word):
      if old_word in sentence:
          return sentence.replace(old_word, new_word)
      return sentence