Python初学者的提问

刚起步学习Python,跟着学的很浅显的知识,有下面这些要求写一个程序,想借鉴一下大家的意见🤓

img


import turtle
def move(x,y):
    turtle.penup()
    turtle.goto(x,y)
    turtle.pendown()

def draw_rectangle_outline(x,y,a,b,color):
    move(x-a/2,y+b/2)
    turtle.pencolor(color)
    turtle.goto(x+a/2,y+b/2)
    turtle.goto(x+a/2,y-b/2)
    turtle.goto(x-a/2,y-b/2)
    turtle.goto(x-a/2,y+b/2)

turtle.hideturtle()
for i in range(10,21):
    draw_rectangle_outline(0,0,i*10,i*10,"black")

求采纳

试试这个:https://blog.csdn.net/weixin_35755823/article/details/113639886