input: 
  def count_chars(string: str) -> dict:
      """ Given a string, count the occurrences of each character and return a dictionary
      mapping each character to its count.
      >>> count_chars("Hello World")
      {'H': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'W': 1, 'r': 1, 'd': 1}
      >>> count_chars("Python")
      {'P': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}
      """
  
output:     char_count = {}
      for char in string:
          if char in char_count:
              char_count[char] += 1
          else:
              char_count[char] = 1
      return char_count