Advertisement
makispaiktis

Rainbow using turtle

May 7th, 2022 (edited)
931
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. import turtle
  2. colors = ["red", "orange", "purple", "yellow", "blue","green"]
  3. t = turtle.Pen()
  4. turtle.bgcolor("black")
  5. turtle.speed(100)
  6.  
  7. for x in range(360):
  8.     t.pencolor(colors[x % len(colors)])
  9.     t.width(x // 100 + 1)
  10.     t.forward(x)
  11.     t.left(59)
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement