input: Write a function to count the frequency of characters in a string.
  assert count_characters("This is a sample string") == {'T': 1, 'h': 1, 'i': 3, 's': 4, ' ': 4, 'a': 2, 'm': 1, 'p': 1, 'l': 1, 'e': 1, 't': 1, 'r': 1, 'n': 1, 'g': 1}
  assert count_characters("hello world") == {'h': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'w': 1, 'r': 1, 'd': 1}
  assert count_characters("aabbcc") == {'a': 2, 'b': 2, 'c': 2}
output: def count_characters(s):
      freq = {}
      for char in s:
          if char in freq:
              freq[char] += 1
          else:
              freq[char] = 1
      return freq