练习
请利用 @property 给一个 Screen 对象加上 width 和 height 属性,以及一个只读属性 resolution :
# -- coding: utf-8 --
class Screen(object):
pass
# test:
s = Screen()
s.width = 1024
s.height = 768
print(s.resolution)
assert s.resolution == 786432, '1024 * 768 = %d ?' % s.resolution