Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1class Dog(Animal) | AError: super() takes no arguments in Python 3 | |
| 2super(Animal).__init__() | BOk: Calls the parent class constructor | |
| 3class Dog(Animal): | COutput: True | |
| 4super().__init__() | DOutput: True | |
| 5issubclass(bool, int) | EValid: Dog inherits from Animal | |
| 6isinstance(True, int) | FError: Missing colon at end of class definition |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Inheritance — A child class receives methods and attributes from a parent class.~~Parent classclass Dog(Animal):
passclass Dog(Animal):
def __init__(self, name, breed):
super().__init__(name)class Dog(Animal):
def speak(self):
return self.name + ' says Woof!'
# this overrides the parentdog = Dog('Rex')
print(isinstance(dog, Animal))class Circle(Shape):
def __init__(self, color, radius):
super().__init__(color)