On Tue, 12 May 2009 14:17:54 +0200, Jaime Fernandez del Rio wrote: > This one I think I know... Try with: > > for k in sorted(word_count) : > print k,"=",word_count[k] > > You need to do the sorting before iterating over the keys...
Isn't that what's happening here? I read this as the 'sorted' function iterating over the keys in word_count, then passing that sorted list to the 'for' loop, for a second iteration over the sorted pairs. No? Tobiah -- http://mail.python.org/mailman/listinfo/python-list