Created
April 2, 2018 10:07
-
-
Save nithyadurai87/d7d964e7374b9f158f63643e2eb5b03e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
wordcount={} | |
for line in sys.stdin: | |
line = line.strip() | |
word= line.split('\t')[0] | |
if word not in wordcount: | |
wordcount[word] = 1 | |
else: | |
wordcount[word] += 1 | |
for i in wordcount: | |
print i, wordcount[i] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment