Complete the code to define a class that inherits from two parent classes.
class Child([1]): pass
In Python, multiple inheritance is done by listing parent classes separated by commas inside parentheses.
Complete the code to call the __init__ method of the first parent class in multiple inheritance.
class Child(Parent1, Parent2): def __init__(self): [1].__init__(self)
To call a specific parent class's __init__, use Parent1.__init__(self).
Fix the error in the code to properly use super() in multiple inheritance.
class Child(Parent1, Parent2): def __init__(self): [1]().__init__()
super() returns a proxy object to delegate method calls properly in multiple inheritance.
Fill both blanks to create a method that calls the same method from all parent classes using super().
class Child(Parent1, Parent2): def greet(self): [1]().[2]()
Use super().greet() to call the greet method from the next class in the method resolution order.
Fill all three blanks to create a class that uses super() in __init__ and a method to demonstrate method resolution order.
class Child([1]): def __init__(self): [2]().__init__() def show(self): print('Child show') [3]().show()
The class inherits from Parent1 and Parent2. super() is used to call the next __init__ and show methods in the method resolution order.