所以我试图创建一个函数,让用户输入矩形的长度和宽度,然后用python在图形中心(使用图形模块)绘制矩形。所以我想知道如何添加坐标,因为我收到错误消息。这是我到目前为止有:如何在Python中添加坐标?

def drawRectangle():
win = GraphWin('Target',200,200)
win.setCoords(0,0,200,200)
width = int(input('Enter the width of your rectangle: '))
length = int(input('Enter the length of your rectangle: '))
**topLeft = Point(100,100)+Point(0,width/2)-Point(length/2,0)
bottomRight = Point(100,100)-Point(0,width/2)+Point(length/2,0)**
rec = Rectangle(Point(topLeft.getX, topLeft.getY), Point(bottomRight.getX, bottomRight.getY))
rec.draw(win)

位这就是搞乱了,我已经把在两个星号

帮助将不胜感激