input: Write a function to count the occurrence of each character in a given string and return a dictionary where the keys are the characters and the values are their respective counts.
  assert char_occurrences("Hello, World!")=={'H': 1, 'e': 1, 'l': 3, 'o': 2, ',': 1, ' ': 1, 'W': 1, 'r': 1, 'd': 1, '!': 1}
  assert char_occurrences("aabbbcc")=={'a': 2, 'b': 3, 'c': 2}
  assert char_occurrences("abcdefg")=={'a': 1, 'b': 1, 'c': 1, 'd': 1, 'e': 1, 'f': 1, 'g': 1}
  assert char_occurrences("")=={}
  assert char_occurrences("123321")=={'1': 2, '2': 2, '3': 2}
output: def char_occurrences(s):
      result = {}
      for char in s:
          if char in result:
              result[char] += 1
          else:
              result[char] = 1
      return result