LogiQuest
Back to Object Oriented Programming
17

What is the output of the following code?

class T:
    def __init__(self):
        self.__secret = 1
t = T()
print(hasattr(t, '__secret'), hasattr(t, '_T__secret'))
Hard

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.