Best Answer · By JanBask Python Expert
Answered on Feb 28, 2021
The explanation you are getting this error is that you are naming the setter method mistakenly. You have named the setter method as set_x which is off base, this is the reason you are getting the Attribute Error.
To fix this error, rather than naming it as set_x you need to give it a similar name as the property you making a setter for, for your situation, you can do it like this:
@x.setter
def x(self, value):
'setting'
self._x = value