input: Write a function to count the occurrence of each character in a given input string. If the input string is empty, 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("")=={}
  assert char_occurrences("aaa")=={'a': 3}
  assert char_occurrences("123")=={'1': 1, '2': 1, '3': 1}
  assert char_occurrences("!@#$")=={'!': 1, '@': 1, '#': 1, '$': 1}
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