jabela

Turtle Color Swatch

Oct 11th, 2018
1,103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. import turtle
  2. colors = ["red","orange","yellow","green","blue","purple","pink","brown","gray","black","white"]
  3.  
  4. turtle.penup()
  5.  
  6. turtle.goto(-300,200)
  7.  
  8. for i in range(11):
  9.     turtle.color(colors[i])
  10.     turtle.begin_fill()
  11.     for i in range (4):
  12.         turtle.forward(30)
  13.         turtle.right(90)
  14.     turtle.end_fill()
  15.     turtle.forward(40)
  16.  
  17. turtle.goto(-300,150)
  18. for i in range(11):
  19.     turtle.color(colors[i])
  20.     turtle.write(colors[i])
  21.     turtle.forward(40)
Add Comment
Please, Sign In to add comment