T
Q. What will be the output of the following Python code?
Code:
class A:
def __init__(self): self.__x = 1
class B(A):
def display(self):
print(self.__x)
def main():
obj = B()
obj.display()
main()
def __init__(self): self.__x = 1
class B(A):
def display(self):
print(self.__x)
def main():
obj = B()
obj.display()
main()
- Correct Answer - Option(B)
- Views: 177
- Filed under category Python
Discusssion
Login to discuss.