Question OOP-ENC-0055
MediumIn Python, what does a single leading underscore, as in self._rate, signal?
- A.
It is a syntax error
- B.
It makes the attribute truly private
- 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
In Python, what does a single leading underscore, as in self._rate, signal?
It is a syntax error
It makes the attribute truly private
Sign up free to see the answer and a step-by-step explanation.
A convention that the attribute is internal and should not be used from outside
It makes it static