Q37
What will be the output of the following Python code? class A: def __init__(self): self._x = 5 class B(A): def display(self): print(self._x) def main(): obj = B() obj.display() main()
A.
Error, invalid syntax for object declaration
B.
Nothing is printed
C.
5
AnswerD.
Error, private class member can't be accessed in a subclass
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board