Shark species

Question P4.2.5

The file shark-species.txt contains a list of extant shark species arranged in a hierachy by order, family, genus and species (with the species given as binomial name : common name). Read the file into a data structure nested dictionaries which can be accessed as follows:

>>> sharks['Lamniformes']['Lamnidae']['Carcharodon']['C. carcharias']
Great white shark

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.