I’ll be honest, it took nearly three hours and about four iterations before I finally figured out how to get this working. What I needed to do was grab
N words with the highest value from a list loaded by
I looked at using a dictionary first, but since dictionaries in Python are unordered, there was no reasonably simple way to sort the dictionary without a
I also looked at
namedtuples, a very cool Python feature, but I would have to load the classes into a list to iterate over them. It quickly became too complicated to keep track of everything.