Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import Counter
- import re
- wc = Counter()
- infile = open("input.txt", "r")
- wordlist = []
- [wordlist.extend(re.findall("\w+", l)) for l in infile]
- for word in wordlist:
- wc[word] += 1
- print wc.most_common(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement