Loading...

The Character Map

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
easy
Seniority
staff

Problem

Our text analytics pipeline needs a character distribution analyzer. Write a function called char_count that takes a string and returns a dictionary mapping each character to its frequency - the NLP team uses this as a preprocessing step for language detection.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.