【廖雪峰Python习题集】面向对象高级编程

使用@property:python 请利用@property 给一个 Screen 对象加上 width 和 height 属性,以及一个只读属性 resolution:spa #_*_coding:utf-8_*_ class Screen(object): @property def width(self): return self._width
相关文章
相关标签/搜索