input: Write a function to count the occurrence of each character in a given string. The function should return a dictionary where the keys are characters and the values are the number of times each character appears in the string. If the input string is empty, then return an empty dictionary.
  
  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("") == {}
output: def char_occurrences(s):
      if not s:
          return {}
      result = {}
      for char in s:
          if char in result:
              result[char] += 1
          else:
              result[char] = 1
      return result