check9.txt Edit this file and then submit it to autolab. Be sure to watch the videos very carefully, and not just skip ahead to the parts required to answer these questions! Be *very brief* in your answers! Seriously. Brief. --------------------------------------------------------------------- 1. Your full name and andrew id: 2. The full names and andrew id's of your groupmates (if you worked collaboratively). 3. Object-Oriented Programming 3.1: What is the difference between an instance and a class? 3.2: Why doesn't our code crash when we call A('yellow', True), even though our __init__ function has three parameters? 3.3: In the video about testing equality of objects, why did A(5) == 9 initially crash? 3.4: Why should we write __repr__ instead of __str__ in most cases? 3.5: Write a one-line __hash__ method for a class, Book, which has two variables, title and author. 3.6 Give an example of two classes that inherit from each other and explain why it makes sense for them to inherit from each other. 3.7: What is the difference between a superclass and a subclass? 3.8: What does super().__init__(x) do? 3.9: Using the code from Section 11.3, add two new lines that print type(b) == object and isinstance(b, object). What are the results? Why do you think you got these results? 3.10: Give an example of a case where you might want to use a class attribute and a case where you might want to use a static method. 4. Recursion (Getting Started) 4.1: Pick an example from the 'Popular Recursion' section and explain why it is recursive. 4.2: Why do all (non-infinite) recursive functions need to have a base case? 4.3: In 'Recursive Math', what's the functional difference between the function f5 and the function f7? 4.4: Why does the base case of the recursive function power return 1, instead of 0 like the base cases of rangeSum and listSum? 4.5: Add a print statement to the top of the basic rangeSum and the divide-and-conquer rangeSum, and count how many times each function is called on the same input. Describe what you observe and do your best to explain it. 4.6: Look over the functions in Section 6. Hypothetically, how many times could we end up in each of the three cases during a single call to power? 4.7: Section 7 shows how functions can be implemented in both iterative and recursive ways. Of course, there can be multiple different iterative and recursive approaches to solve a problem. Describe two approaches, one iterative and one recursive, which you could use to solve the second example, reverse. These approaches should be different than the ones shown on the website.