Vidyalelo
Python · Q40

Classes and Objects in Python

Programming · Python · question 40

Q40

What is the output of the following code:class Parent: def init(self): print('Parent constructor')class Child(Parent): def init(self): print('Child constructor')obj = Child()

A.
Child constructor
Answer
B.
Parent constructor
C.
An error will occur
D.
Child Parent

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board