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