input: Write a function to count the number of occurrences of each character in a given string and return the result as a dictionary.
  assert count_chars("Hello World")=={'H': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'W': 1, 'r': 1, 'd': 1}
  assert count_chars("Python")=={'P': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}
  assert count_chars("aabbcc")=={'a': 2, 'b': 2, 'c': 2}
  assert count_chars("")=={}
  assert count_chars("aaaaa")=={'a': 5}
output: def count_chars(s):
      result = {}
      for char in s:
          if char in result:
              result[char] += 1
          else:
              result[char] = 1
      return result