Loading...
The Word Counter
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- junior, mid
Problem
Given a block of text (a string representing file contents), count how many times each unique word appears. Words should be compared case-insensitively and stripped of punctuation. Return a dictionary mapping each lowercase word to its count.
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.