Friday, November 20, 2009
Monday, November 2, 2009
Chapter 4 --Page 140-141 -- Listing 4.7
The values method returns a dict_values object, not a list. However, it can be turned into a list by using the list() function. Line 10 of listing 4.7 should be
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.
Subscribe to:
Posts (Atom)