Complete the code to override the method greet in the child class.
class Parent: def greet(self): print("Hello from Parent") class Child(Parent): def [1](self): print("Hello from Child") c = Child() c.greet()
greet.Complete the code to call the overridden method from the child class instance.
class Animal: def sound(self): print("Some sound") class Dog(Animal): def sound(self): print("Bark") pet = Dog() pet.[1]()
sound is overridden in the Dog class and called on the instance.Fix the error in the child class method overriding by completing the method name correctly.
class Vehicle: def start(self): print("Vehicle started") class Car(Vehicle): def [1](self): print("Car started") my_car = Car() my_car.start()
start to replace the parent method.Fill both blanks to override the method and call the parent method inside the child method.
class Writer: def write(self): print("Writing...") class Author(Writer): def [1](self): print("Author starts writing") super().[2]() a = Author() a.write()
write and calls the parent write method using super().Fill all three blanks to override the method, call the parent method, and add extra behavior.
class Printer: def print_message(self): print("Printing message") class ColorPrinter(Printer): def [1](self): super().[2]() print([3]) cp = ColorPrinter() cp.print_message()
print_message, calls the parent method, and adds a new print statement.