input: Write a Python function to count the frequency of each word in a string.
  assert word_freq('This is a test string to test the function') == {'This': 1, 'is': 1, 'a': 1, 'test': 2, 'string': 1, 'to': 1, 'the': 1, 'function': 1}
  assert word_freq('hello world hello') == {'hello': 2, 'world': 1}
  assert word_freq('word frequency count word word') == {'word': 3, 'frequency': 1, 'count': 1}
output: def word_freq(s):
      words = s.split()
      freq = {}
      for word in words:
          if word in freq:
              freq[word] += 1
          else:
              freq[word] = 1
      return freq