input: Write a function to replace a given word in a string with another word. The function should take three parameters: the original sentence, the word to be replaced, and the new word. It should return the modified sentence with the word replaced.
  
  def replace_word(sentence, old_word, new_word):
      return sentence.replace(old_word, new_word)
  
  assert replace_word("I love walking on the beach", "walking", "swimming") == "I love swimming on the beach"
  assert replace_word("Cats are wonderful pets", "Cats", "Dogs") == "Dogs are wonderful pets"
  assert replace_word("Life is full of surprises", "full", "empty") == "Life is empty of surprises"
  assert replace_word("Programming is fun", "is", "was") == "Programming was fun"
  assert replace_word("", "walking", "swimming") == ""
output: def replace_word(sentence, old_word, new_word):
      return sentence.replace(old_word, new_word)