input: Write a python function to count the frequency of each character in a string.
  assert frequency('hello') == {'h': 1, 'e': 1, 'l': 2, 'o': 1}
  assert frequency('world') == {'w': 1, 'o': 1, 'r': 1, 'l': 1, 'd': 1}
  assert frequency('hello world') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'w': 1, 'r': 1, 'd': 1}
output: def frequency(s):
      freq = {}
      for char in s:
          if char in freq:
              freq[char] += 1
          else:
              freq[char] = 1
      return freq