Hello,
I am struggling to find out what's wrong with my code.
I have two objects called ObjA and ObjB.
Both ObjA and ObjB have attributes named size, and the size is Very Large for both of them.
However when I do the comparison such as
I do not know ? Please help me if you could.
Many Thanks!
I am struggling to find out what's wrong with my code.
I have two objects called ObjA and ObjB.
Both ObjA and ObjB have attributes named size, and the size is Very Large for both of them.
However when I do the comparison such as
if aObj.attributes['size'] == bObj.attributes['size']: print "They are equal"It gave me an error saying :
Error:if aObj.attributes['size'] == bObj.attributes['size']:
KeyError: 'size'
I do not know why it gave me the error. Is it size a reserved key word so that I could not use it or is it some thing else that I do not know ? Please help me if you could.
Many Thanks!