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?

28th May 2020, 11:32 AM
Catherine James
Catherine James - avatar
3 Antworten
+ 1
you have not attribute cla. you have _cls, so write getter property cls and everything will be ok
28th May 2020, 7:18 PM
george
george - avatar
+ 1
@property def cls(self): return self._cls
28th May 2020, 7:20 PM
george
george - avatar
0
Thank you :)
28th May 2020, 8:42 PM
Catherine James
Catherine James - avatar