class Point:
def __init__(self,X,Y):
self.x = X
self.y = Y
class Rect:
def __init__(self,lefttop_Point,rightbottom_Point):
self.left_top = lefttop_Point
self.right_bottom = rightbottom_Point
def __contains__(self,xy):
if self.left_top.x <= xy.x <= self.right_bottom.x \
and self.right_bottom.y <= xy.y <= self.left_top.y:
return True
return False
rectA = Rect(Point(10,10),Point(20,5))
print(Point(15,8) in rectA)