input: Write a function to count the occurrence of each character in a given input string. The function should return a dictionary where the keys are the characters and the values are the number of times each character appears in the string.
  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("Python")=={'P': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}
  assert char_occurrences("")=={}
output: def char_occurrences(s):
      result = {}
      for char in s:
          if char in result:
              result[char] += 1
          else:
              result[char] = 1
      return result