Question OOP-ENC-0040
EasyWhat is the output of this code?
class A:
def __init__(self):
self._x = 3
print(A()._x)
- A.
None
- B.
3
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Encapsulation question
What is the output of this code?
class A:
def __init__(self):
self._x = 3
print(A()._x)
None
3
Sign up free to see the answer and a step-by-step explanation.
Error
_x