input: Write a python function to count the frequency of words in a given string.
  assert word_frequency("This is an example of a string of words") == {'This': 1, 'is': 1, 'an': 1, 'example': 1, 'of': 2, 'a': 1, 'string': 1, 'words': 1}
  assert word_frequency("hello world hello") == {'hello': 2, 'world': 1}
  assert word_frequency("test the function test the code") == {'test': 2, 'the': 2, 'function': 1, 'code': 1}
output: def word_frequency(s):
      words = s.split()
      frequency = {}
      for word in words:
          if word in frequency:
              frequency[word] += 1
          else:
              frequency[word] = 1
      return frequency