input: Write a function to count the occurrence of each character in the given input string. If no characters are present in the string, return an empty dictionary. The function should iterate through the string, updating a dictionary with the character as the key and its frequency as the value.
  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("aaaAAA")=={'a': 3, 'A': 3}
output: def char_occurrences(input_string):
      result = {}
      for char in input_string:
          if char in result:
              result[char] += 1
          else:
              result[char] = 1
      return result