I am having an unexpected issue. This is the simplified code:
class test():
def __init__(self,name):
self.name = name
def __private(self):
print(self.name)
def public(self):
exec("self.__private()")
obj = test('John')
obj.public()
does anyone know how I can make this code work without getting rid of the exec statement?