> def SortDict(adict): > """ this function sorts the frequency/key pairs in the > dictionary by highest to lowest frequency """ > counts = {} > for word in adict.items(): At this point word contains a tuple of key,value. I suspect you only want to extract the keys. > if counts.has_key(word): Especially since you are comparing with a key... Alan G.