?
What will be the output of the following Python code?
What will be the output of the following Python code?
class Demo:
def __init__(self):
self.a = 1
self.__b = 1
def display(self):
return self.__b
obj = Demo()
print(obj.a)
class Demo:
def __init__(self):
self.a = 1
self.__b = 1
def display(self):
return self.__b
obj = Demo()
print(obj.a)
Join the Discussion
Login to post a comment or share your explanation.
Login