0
How to remove the error while displaying the items in Department class? Please check the code bit attached.
When I call it directly, it says that the class doesn't have the attributes but when I call the functions that display the attributes, it works. https://code.sololearn.com/c3Lj0B5mVd6H/?ref=app Also is there a way to display the 3rd parameter in Department class as it is from the dictionary myInstances?
3 Antworten
+ 1
you have not attribute cla. you have _cls, so write getter property cls and everything will be ok
+ 1
@property
def cls(self):
return self._cls
0
Thank you :)