turtle画图代码大全

  • A+
所属分类:百科知识

1.彩色螺旋线

from turtle import *
import turtle
t = Turtle()
t.pensize(2)
turtle.bgcolor("black")
colors = ["red", "yellow", 'purple', 'blue']
t._tracer(False)
for x in range(400):
    for y in range(200):
        t.forward(x * y)
        t.color(colors[x % 4])
        t.left(91)
t._tracer(True)
done()

turtle画图代码大全

历史上的今天:

weinxin
自学设计网
微信扫一扫领取设计学习资料/本站会员
推荐应用

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: