All exercises

Word frequency

ChallengePython

Runs entirely in your browser — your code never leaves your machine.

Problem

Write word_count(text) that returns a dict mapping each lowercased word to how many times it appears. Split on any whitespace. word_count('a b a') → {'a': 2, 'b': 1}

Related cheat sheet
Your code
Press Run tests to check your solution.