例子一:
import turtle
t = turtle.Pen()
turtle.bgcolor("black")
sides=6
colors=["red","yellow","green","blue","orange","purple"]
for x in xrang(360):
t.pencolor(colors[x%sides])
t.forward(x*3/sides+x)
t.left(360/sides+1)
t.width(x*sides/200)
print("####結束####")
效果圖如下:
TAG:Python |