Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Count words
import sys
users = {}
for line in sys.stdin:
username = line.strip('\n')
if username not in users:
users[username] = 1
users[username] += 1
for k, v in users.iteritems():
print "{0} {1}".format(k, v)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment