RosettaCodeData/Task/Letter-frequency/Python/letter-frequency-1.py
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

7 lines
180 B
Python

import collections, sys
def filecharcount(openfile):
return sorted(collections.Counter(c for l in openfile for c in l).items())
f = open(sys.argv[1])
print(filecharcount(f))