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