The Word Census
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L3
Problem
Given a string of whitespace-separated words, return a dict mapping each distinct lowercased word to its count. (Test harness accepts any key order; note the expected output shows sorted-by-count which may not be guaranteed by dict iteration - be explicit: return a regular dict.)
Summary
Who said what - and how many times?
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.