Code:
class Person(object):
def __init__(self,name):
self.name=name
self.__education='Engineering'
def displayInfo(self):
name=self.name
education=self.__education
print("My name is",name,"and I have completed my",education)
if __name__=='__main__':
myObj=Person("Utara")
myObj.displayInfo()
print(myObj.name)
print(myObj.__education)
print(myObj._Person__education)
En esta página del sitio puede ver el video en línea 231. How Private Variables Work in Python in Python with Code || Private Variable, Public Variable de Duración hora minuto segunda en buena calidad , que subió el usuario Bhavatavi 11 noviembre 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 2 veces y le gustó 0 a los espectadores. Disfruta viendo!