It works : orderedwords = sorted(textstorage.keys(), key=textstorage.get) The method textstorage.get will accept a word and return it's value which in this instance is the count.
What I don't understand is: for w in eachword: textstorage[w]=textstorage.get(w, 0) + 1 How does textstorage.get(w,0)+1 give the count of the word?? Thanks, Shiva -- https://mail.python.org/mailman/listinfo/python-list