Almost last set of official solutions and final quiz.
import keywordf = open('/path/to/file')freq = {}for line in f: words = line.split() for word in words: key = word.strip(',.!;?()[]: ') if keyword.iskeyword(key): value = freq[key] freq[key] = value + 1print freq