Grouping words by their length using a defaultdict

Question Q4.2.5

Modify Example E4.8 to use a defaultdict to produce a list of words, keyed by their length from the text of the first line of the Gettysburg Address.


Solution

To access solutions, please obtain an access code from Cambridge University Press at the Lecturer Resources page for my book (registration required) and then sign up to scipython.com providing this code.