Python - Inheritance and Code Reuse
You want to extend a parent class method
calculate so that the child class adds 10 to the parent's result. Which code correctly does this?
class Parent:
def calculate(self):
return 5
class Child(Parent):
def calculate(self):
# Fill here
