Q72
What will be the output of the following Python code? class Test: def __init__(self): self.x = 0 class Derived_Test(Test): def __init__(self): self.y = 1 def main(): b = Derived_Test() print(b.x,b.y) main()
A.
0 1
B.
0 0
C.
Error because class B inherits A but variable x isn't inherited
AnswerD.
Error because when object is created, argument must be passed like Derived_Test(1)
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board