You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classA:
def__init__(self, cash):
self.msg="I am A"self.cash=cashdef__iama(self):
print(f"{self.msg} and have ${self.cash}")
classB:
def__init__(self):
self.A=A(5)
defshow(self):
self.A.__iama()
if__name__=='__main__':
B().show()
Error:
Traceback (most recent call last):
File "/home/fmadmin/workspace/test_automation/src/./example.py", line 19, in <module>
B().show()
File "/home/fmadmin/workspace/test_automation/src/./example.py", line 16, in showself.A.__iama()
^^^^^^^^^^^^^AttributeError: 'A' object has no attribute '_B__iama'. Did you mean: '_A__iama'?