Reference solution
The shape we check against. Any implementation that passes the assertions is valid — this one favours clarity.
def word_counts(text):
counts = {}
for w in text.lower().split():
counts[w] = counts.get(w, 0) + 1
return counts