第14546题 单选题
给定Python的Point、Rect类及实例代码,以下说法正确的是?
class Point:
    def __init__(self,x,y):
        self.x = x
        self.y = y
class Rect:
    def __init__(self,lefttop_point,rightbottom_point):
        self.lefttop = lefttop_point
        self.rightbottom = rightbottom_point
    def __contains__(self,y):
        if self.lefttop.x<=y.x<=self.rightbottom.x and self.lefttop.y<=y.y<=self.rightbottom.y:
            return True
        else:
            return False
rectA = Rect(Point(10,10),Point(20,5))
print(Point(15,18) in rectA)
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析