12345678910111213141516171819202122232425262728293031 |
- class Point:
- def __init__(self, x, y):
- self.x = x
- self.y = y
- @property
- def x(self):
- return self._x
- @x.setter
- def x(self, value):
- self._x = int(value)
- @property
- def y(self):
- return self._y
- @y.setter
- def y(self, value):
- self._y = int(value)
- def main():
- point = Point(2, 5)
- print(point.x)
- print(point.y)
- if __name__ == '__main__':
- main()
|