Count normalized words
Split text on whitespace, lowercase each word, and return a dict of counts. Punctuation remains part of a word.
text = 'One one\tTWO'
print(text.lower().split())Reason about the state
Whitespace splitting handles consecutive spaces and tabs. Lowercase before updating a frequency table for expected linear time. Before writing code, identify what each variable means after one iteration. Walk through the example and explain why the next transition preserves that meaning. Then check the smallest permitted input and a case with repeated values. A correct answer follows the contract for every input, including the boundary cases in the checks. Keep any input mutation within the stated rules; return a fresh result when the task asks for one.
Your task
Split text on whitespace, lowercase each word, and return a dict of counts. Punctuation remains part of a word.
The explanation opens here once every check passes.