A class keeps one attribute with two leading underscores and one with a single underscore. class Safe: def __init__(self): self.__code = 42 self._hint = "4x" s = Safe() s.__code = 7 print(s._Safe__code, s.__code, s._hint) What does the program print?
Log in to join the discussion.
Loading…