Q. What is the output of this code?
Code:
class A:
def __init__(self):
print("A init")
class B(A):
pass
b = B()
β
Correct Answer: (B)
A init
Explanation: B inherits A and doesn't override __init__, so A’s constructor is used.