python之第一个彩色螺旋小程序

import turtle

turtle.pensize(2)
turtle.bgcolor("black")
colors = ["red","yellow","purple","blue"]
for x in range(400):
turtle.forward(2 * x)
turtle.color(colors[x % 4])
turtle.left(91)
turtle.done()
posted @ 2021-04-01 17:49  斐语  阅读(123)  评论(0编辑  收藏  举报