# Count object # Count.get_sorted_pairs() # Count.increment_key( key ) # File object # File( name = 'file to open') # File.loop_over_words( function_to_apply ) # Pair object # __str__() reasonable string representation count = Count() # create a Counter file = File( name = 'moby_dick.txt' ) # create a File file.loop_over_words( count.increment_key ) pairs = count.get_sorted_pairs( order = 'decreasing', which = 'value' ) print pairs