import re sums = dict() fh= open(\'wordcount.txt\',\'r\') for line in fh: words = [word.lower() for word in re.findall(r\'\\b\\w+\\b\', line)] for word in (w
>>> from pprint import pprint >>> pprint(sums) {'air': 2, 'and': 1, 'at': 3, 'be': 1, 'body': 1, ....., # and so on... 'you': 2}