Home > other >  Python error: getattribute
Python error: getattribute

Time:10-18

 
Class a Rectangle:
Def __init__ (self, width=0, height=0) :
The self. The width=width
The self. The height=height

Def __setattr__ (self, name, value) :
If name=="square" :
The self. The width=value
The self. The height=value
The else:
Super (). __setattr__ (name, value)

Def getArea (self) :
Return the self. The width * self. Height





Error:
The getattribute
The getattribute
The getattribute
The getattribute
The getattribute
The getattribute
The getattribute
The getattribute
The getattribute


Problem: run the program will appear as a result, the above follow video to school, don't know how to make a mistake, beg god taught!
  • Related