import re sums = dict() fh= open(\'wordcount.txt\',\'r\') for line in fh: words = [word.lower() for word in re.findall(r\'\\b\\w+\\b\', line)] for word in (w
Another complex way using lambda
f = lambda *x: null; f( *( print( x,":",y ) for x,y in mydict.iteritems() ) )
Output
key2 : 2 key1 : 1