__init__ constructor

On this page

init

Initializes a new instance of the Rectangle class.

def __init__(self, x, y, width, height):
    ...
Parameter Type Description
x int The x-coordinate of the upper-left corner.
y int The y-coordinate of the upper-left corner.
width int The width of the rectangle.
height int The height of the rectangle.

See Also

On this page