发布网友 发布时间:2022-04-21 10:09
共1个回答
热心网友 时间:2022-04-18 03:55
def drawRectangle(x = 0.0, y = 0.0, width = 10.0, height = 10.0, color = "black"):
turtle.penup()
turtle.goto(x + width / 2.0, y + height / 2.0)
turtle.color(color)
turtle.pendown()
for i in range(0, 2):
turtle.right(90)
turtle.forward(height)
turtle.right(90)
turtle.forward(width)
turtle.penup()