input: Write a function to replace a given word in a string with another word. If the given string or words are empty, return the original string.
  
  assert replace_word("I love walking on the beach", "walking", "swimming") == "I love swimming on the beach"
  assert replace_word("The quick brown fox", "brown", "red") == "The quick red fox"
  assert replace_word("", "walking", "swimming") == ""
  assert replace_word("I love walking on the beach", "", "swimming") == "I love walking on the beach"
  assert replace_word("I love walking on the beach", "walking", "") == "I love  on the beach"
output: def replace_word(s, old_word, new_word):
      if not s or not old_word:
          return s
      return s.replace(old_word, new_word)