top_word(path) returning the most frequent word in a text file, case-insensitive, with words split on whitespace and stripped of .,!?;: punctuation at the ends. Ties may break arbitrarily. Return None for an empty file.top_word('essay.txt') # 'The cat saw the dog. The dog ran.''the'
'the' appears three times, beating dog's two.
A plain dict (or collections.Counter) tallies counts.
max(counts, key=counts.get) finds the winner.