Discuss / Python / 没什么可说的

没什么可说的

Topic source

护苗2018

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

Code:

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):
        return self.__height * self.__width

  • 1

Reply