countlist = list(countlist.values())
Then the max function is legal on countlist (as shown on line 11).
The text on page 140 should read
Recall that the values() method returns a dict_values object which can be turned into a list by applying the list function.