CS 0007: Fall 2009 Lab 9 Today will be bread and butter programming practice. Part 1========== There is a bug in debug.py. Please fix the bug. Trace the code to figure out what is wrong. You can use paper, Wing, or add print statements to the code to trace it. Part II========= Suppose we have a nested list like this: pets = [["Shoji", "cat", 18], ["Hanako", "dog", 15], ["Sir Toby", "cat", 10], ["Sachiko", "cat", 7], ["Sasha", "dog", 3], ["Lopez", "dog", 13]] As you know, we can access the list elements with numbers, like this: >>> pets[0] ["Shoji", "cat", 18] We can also access elements of the inner lists. For example, the third element of the second element of list pets (the age of the dog ) is: >>> pets[1][2] 15 Below, we'll call a list like pets a "pet list". Write the following functions and call each function to verify your work: 1. Write a function num_dogs that takes a pet list L as a parameter and computes the number of dogs in the list. 4. Write a funcion ages that takes a pet list L as a parameter computes the sum of the ages of the animals in the list. Ages are the third element of the inner lists. 5. Write a function nested_lengths that takes a list L as a parameter and returns a list of the lengths of the sublists. More formally: for each element e in L, the returned list contains a corresponding element, c, that represents the number of elements in e.