Interview Q&A / Object-Oriented Programming
Object-Oriented Programming interview questions
The four pillars, interfaces, abstract classes and design basics.
Prefer rapid revision? Practise Object-Oriented Programming short interview answers →
- Does Python have private attributes? What do _x and __x mean?
Python has no true private. A single underscore _x is a hint that it is internal. A double underscore __x triggers name mangling, which renames it to _ClassName__x to avoid clashes in subclasses.
IntermediateQuick answer1 min read