幻彩螺旋
import turtle as t
t.reset()
t.screensize(800,800,‘black’)
t.pensize(2)
t.speed(‘fastest’)
colors=[‘yellow’,‘red’,‘green’,‘purple’]
for x in range(200):
t.fd(2*x)
t.color(colors[x%4])
t.lt(89)
t.hideturtle()
t.done()
开启python之旅——幻彩螺旋
进阶版
import turtle as t
t.reset()
t.screensize(800,800,‘black’)
t.pensize(2)
t.speed(‘fastest’)
colors=[‘yellow’,‘red’,‘green’,‘purple’,‘blue’,‘orange’]
for x in range(200):
t.fd(x)
t.color(colors[x%6])
t.lt(59)
t.hideturtle()
t.done()
开启python之旅——幻彩螺旋
你们发现规律了吗
(嘿嘿)

相关文章:

  • 2021-08-05
  • 2021-05-18
  • 2021-09-30
  • 2022-01-14
  • 2022-12-23
  • 2018-11-05
  • 2021-09-02
  • 2021-12-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-05-08
  • 2020-06-15
  • 2022-12-23
  • 2021-04-25
相关资源
相似解决方案