import turtle

def mygoto(x, y):
    turtle.up()
    turtle.goto(x, y)
    turtle.down()

def drawstar(x):
    turtle.begin_fill()
    for i in range(5):
        turtle.forward(x)
        turtle.right(144)
    turtle.end_fill()

turtle.setup(600,400,0,0)
turtle.color("yellow")
turtle.bgcolor("red")
turtle.fillcolor("yellow")

mygoto(-260,120)
drawstar(120)

mygoto(-120,160)
turtle.left(15)
drawstar(40)

mygoto(-80,120)
turtle.left(12)
drawstar(40)

mygoto(-80,60)
drawstar(40)

mygoto(-120,20)
turtle.left(30)
drawstar(40)

turtle.hideturtle()

turtle.done()

  

Python画空心矩形 python绘制空心五角星_ide