Private Variable and public Variable in python class

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

As pervious comments by lewos, I think there is no concept of private in Python. Its just for notation and understanding between collabarators. Also double underscore variables aren't private, their name gets mangled by interperter and still are accessible from object.

jagtaphimanshu
Автор

You should be careful thought, there no concept of a private attributes in python, you can still access the variable . If you print dir(t) you can see the atributtes under the name _Test__var1

leo.carminatti
Автор

none is coming bcoz print(print()) is used.

amarbudhiraja
Автор

Why u calling function for class?
I have learned something new from u. thank u.

SaurabhGangamwar