Python - Inheritance and Code Reuse
Consider this code:
What will be printed?
class Base:
def __init__(self, x):
self.x = x
class Derived(Base):
def __init__(self, x, y):
super().__init__(x)
self.y = y
obj = Derived(5, 10)
print(obj.x, obj.y)What will be printed?
