contains method

contains(self, point)

Determines if the specified point is contained within this rectangle.

Returns

True if the point is contained within this rectangle; otherwise, False.

def contains(self, point):
    ...
ParameterTypeDescription
pointPointFThe point to test. Any object with x and y attributes is accepted.

Exceptions

ExceptionDescription
TypeErrorWrong number of arguments.

contains(self, rect)

Determines if the rectangular region represented by rect is entirely contained within this rectangle.

Returns

True if the rectangular region represented by rect is entirely contained within this rectangle; otherwise, False.

def contains(self, rect):
    ...
ParameterTypeDescription
rectRectangleFThe rectangle to test. Any object with x, y, width and height attributes is accepted.

Exceptions

ExceptionDescription
TypeErrorWrong number of arguments.

contains(self, x, y)

Determines if the specified point is contained within this rectangle.

Returns

True if the point defined by x and y is contained within this rectangle; otherwise, False.

def contains(self, x, y):
    ...
ParameterTypeDescription
xfloatThe x-coordinate of the point to test.
yfloatThe y-coordinate of the point to test.

Exceptions

ExceptionDescription
TypeErrorWrong number of arguments.

See Also