Discuss / Python / Macyrate

Macyrate

Topic source

Macyrate

#1 Created at ... [Delete] [Delete and Lock User]

鬼知道我学了什么,鬼知道我在写什么,然而反正就是测试通过了

class Screen(object):
    @property
    def width(self):
        return self._width

    @width.setter
    def width(self,value):
        self._width = value
    
    @property
    def height(self):
        return self._height    

    @height.setter
    def height(self,value):
        self._height = value

    @property
    def resolution(self):
        self._resolution = self._width * self._height
        return self._resolution
    

哈哈哈,我也是,反正照着写就好了


  • 1

Reply