Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import collections as C
  2. count_word = C.Counter()
  3. with open('input.txt', 'r') as f_in:
  4.     for line in f_in.readlines():
  5.         for word in line.split():
  6.             if not len(word.decode('utf-8'))<3:
  7.                 count_word[word] += 1
  8.                
  9. print(repr(count_word.most_common(10)).decode('string_escape'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement