- 1
How do I fill in the blanks to make the egg attribute strongly private and access it from outside of the class?
I just don't understand how you do it. class Test: __egg = 7 t = Test() print(t._Test_____)
2 Respuestas
+ 1
@property is not answer 😂😂
- 1
to access the private attribute you prefix them with the undescore and name of their class. Like this:
print(t._Test__egg)