Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import collections as C
- count_word = C.Counter()
- with open('input.txt', 'r') as f_in:
- for line in f_in.readlines():
- for word in line.split():
- if not len(word.decode('utf-8'))<3:
- count_word[word] += 1
- print(repr(count_word.most_common(10)).decode('string_escape'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement