hist (227B)
1 #!/usr/bin/env python 2 3 import sys 4 5 hist = {} 6 for line in sys.stdin.readlines(): 7 x = line[:-1] 8 if x is '': 9 continue 10 hist[x] = (hist.get(x) or 0) + 1 11 12 for key, count in hist.items(): 13 print("{}\t{}".format(count,key))