I'm basically trying to iterate through a dict and print out the key / values from largest value to lowest. I have been searching this site and a lot of people are using lambda but I'm not really sure how its working so I'm trying to avoid it for now.
dictIterator = iter(sorted(bigramDict.iteritems()))
for ngram, value in dictIterator:
print("There are " + str(value) + " " + ngram)
Looking over the code above I assumed it would make an iterator which returns the key/value pairs in order from largest to smallest but it's not.
Can anyone see what the problem is? or another method of doing this?