class Point(object):
def __init__(self, x, y):
self.X = x
self.Y = y
def move_by(self, dx, dy):
self.X = self.X + dx
self.Y = self.Y + dy
def move_to(self, x, y):
self.X = x
self.Y = y
def __str__(self):
return "Я - точка: %s x %s" % (self.X, self.Y)
a = Point(15, 10)
print(a)
a.move_to(25, 5)
a.move_by(-5, 5)
print("NewX:", a.X)
print("NewY:", a.Y)