PythonSkills.org
Courses
Exercices
Challenges
Quizzes
Open console
0 points
Get started
Loading...
All Challenges
Loading...
Loading...
Count occurrences of each character
Write a function that takes a string and returns a dictionary with each unique character as the key and its number of occurrences as the value.
Intermediate
Hint
sample input: hello
sample output: {"h": 1, "e": 1, "l": 2, "o": 1}
Loading...
Run Tests
Clear Tests
Test Output:
Show Solution
Show Code
Not Solved