importturtle##python中的图形库
colors=["red","yellow","purple","blue","black","green"]
turtle.pensize(2)
turtle.setup(width=800, height=800, startx=400, starty=0)
turtle.pencolor("white")#默认中心点开始,gisoracle
turtle.goto(0,300)for num in range(3,20):
turtle.pencolor(colors[num%6])
angle= 180 - (num - 2) * 180 /numfor i inrange(num):
turtle.begin_fill()
turtle.forward(100)
turtle.right(angle)
turtle.end_fill()
turtle.done()