input: 
  def replace_word_in_string(sentence: str, old_word: str, new_word: str) -> str:
      """Replace the old word with the new word in the given sentence.
      >>> replace_word_in_string("I love walking on the beach", "walking", "swimming")
      'I love swimming on the beach'
      >>> replace_word_in_string("Python is fun to learn", "fun", "exciting")
      'Python is exciting to learn'
      """
  
output:     words = sentence.split()
      for i in range(len(words)):
          if words[i] == old_word:
              words[i] = new_word
      return ' '.join(words)