Python - Inheritance and Code Reuse
What will be the output of this code?
class Parent:
def greet(self):
print('Hello from Parent')
class Child(Parent):
def greet(self):
print('Hello from Child')
obj = Child()
obj.greet()What will be the output of this code?
class Parent:
def greet(self):
print('Hello from Parent')
class Child(Parent):
def greet(self):
print('Hello from Child')
obj = Child()
obj.greet()15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions