RaspiBerry Blog

CnLiutiezhu is here!

python绘图

| 暂无评论

import turtle as t
t.bgcolor("black")
sides = 2
colors =["red","yellow","blue","orange","green","purple","pink"]
for x in range(270):
    t.pencolor(colors[x%sides])
    t.fd(x*2)
    t.left(360/sides+1)
    t.width(x*sides/150)
t.done()

发表回复

*为必填字段!