
code counter
By:
reidhoruff on
Sep 10th, 2011 | syntax:
Python | size: 0.43 KB | hits: 72 | expires: Never
valueCount = {}
def process( input ):
for line in input:
for char in line.strip():
if valueCount.has_key(char.lower()):
valueCount[char.lower()] += 1
else:
valueCount[char.lower()] = 1
def printRes():
for w in sorted(valueCount, key=valueCount.get, reverse=True):
print w, valueCount[w]