Q. How can a private attribute be accessed outside a class?

A
Dot notation
B
get() method
C
Name mangling (_Class__attr)
D
Cannot access
Solution:

Name mangling (_Class__attr) allows access to private attributes, e.g., _Class__value.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!