|
|
|
|
|
by Goladus
4539 days ago
|
|
I like this one. Though I would do it like this to keep the lines under 80 characters: words=open('test.txt').read().lower().split()
for word, count in Counter(words).most_common():
print word, count
(edited per child comment) |
|
One nitpick: it's Pythonic (I think) to just name the list of words "words" rather than "word_list".