import text_analyzer as text filename = 'monster.txt' text.compute_noun_count(filename) n = 10 max_font = 30 (noun, count) = text.get_top() max_count = count for i in range(n): print(noun, 'occurs', count, 'times') text.noun_count.pop(noun) (noun, count) = text.get_top() # For monster.txt, you should get: # barn occurs 12 times # night occurs 7 times # dad occurs 6 times # monster occurs 5 times # noise occurs 4 times # flashlight occurs 4 times # owl occurs 3 times # screech occurs 2 times # roof occurs 2 times # bed occurs 1 times