input: Write a function to count the occurrences of each word in a given string.
  assert count_words("This is a test This is only a test") == {'This': 2, 'is': 2, 'a': 2, 'test': 2, 'only': 1}
  assert count_words("hello world hello") == {'hello': 2, 'world': 1}
  assert count_words("Python is great and Python is fun") == {'Python': 2, 'is': 2, 'great': 1, 'and': 1, 'fun': 1}
output: def count_words(s):
      words = s.split()
      word_count = {}
      for word in words:
          if word in word_count:
              word_count[word] += 1
          else:
              word_count[word] = 1
      return word_count