Question: class MyClass: def _ _ init _ _ ( self ) : self. _ _ hidden _ attribute = 1 0 def get _ hidden

class MyClass: def __init__(self): self.__hidden_attribute =10 def get_hidden_attribute(self): return self.__hidden_attribute obj = MyClass() print(obj.get_hidden_attribute()) # Output: 10 print(obj.__hidden_attribute) # This will raise an AttributeError

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!