- 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_____)

1st Nov 2020, 10:50 PM
Vicious Playz
Vicious Playz - avatar
2 Answers
+ 1
@property is not answer 😂😂
7th Dec 2020, 5:59 PM
Turikumana Isaie
Turikumana Isaie - avatar
- 1
to access the private attribute you prefix them with the undescore and name of their class. Like this: print(t._Test__egg)
2nd Nov 2020, 4:02 AM
Volodymyr Chelnokov
Volodymyr Chelnokov - avatar