#P0037. 字符频次统计

字符频次统计

1. Description

Count the frequency of each character in the input string (case-sensitive, including spaces and symbols).

2. Input & Output

Input:

  • A single line string read via input().

Output:

  • A dictionary where keys are characters and values are their counts.

Example

# Input:  
hello  
# Output:  
{"h": 1, "e": 1, "l": 2, "o": 1}  
# Input:  
Hello World!  
# Output:  
{"H": 1, "e": 1, "l": 3, "o": 2, " ": 1, "W": 1, "r": 1, "d": 1, "!": 1}