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)
On this page of the site you can watch the video online 231. How Private Variables Work in Python in Python with Code || Private Variable, Public Variable with a duration of hours minute second in good quality, which was uploaded by the user Bhavatavi 11 November 2022, share the link with friends and acquaintances, this video has already been watched 2 times on youtube and it was liked by 0 viewers. Enjoy your viewing!