绘制彩图--矩形

photoor 1年前 ⋅ 354 阅读

import turtle

turtle.bgcolor('black')

turtle.title('Welcom star')

turtle.setup(800,600)

colors=['green','red','cyan','pink','purple','blue','yellow','orange']

tpen=turtle.Pen()

y=len(colors)

for x in range (1,101):

tpen.color(colors[x%y])

tpen.fd(x*10)

tpen.left(90)

turtle.mainloop()

L7.PNG


全部评论: 0

    我有话说: