Advertisement
maynul67

turtle: random pattern generator

Jul 28th, 2021
920
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. import random
  3. colors = ['red', 'yellow','green','blue', 'purple', 'grey', 'white','orange','violet']
  4. t = turtle.Pen()
  5. t.width(1.5)
  6. turtle.bgcolor('black')
  7. for x in range(200):
  8.     col = random.randint(0,8)
  9.     t.pencolor(colors[col])
  10.     t.forward(x)
  11.     t.left(60)
  12.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement