Word frequency count FIXED by

import re
s=[]
while 1:
    try:s+=re.sub("[^a-z\s]","",raw_input().lower()).split()
    except: break
for i in sorted(set(s)): print "%s %s"%(s.count(i), i)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page