class Room: def _init_(self,name,owner,width,length) self.name= name self.name=owner self. @property#将函数属性封装成静态属性,不用()即可运行 def cal_area(self): return(self.width * self.length) print(r1.cal_area) print(r2.cal_area)