Advertisement
brianMc

Python Turtle Circle Design

Aug 31st, 2018
493
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import turtle as t
  3. import random
  4. t.setup(width=600, height=600)
  5. t.speed(500)
  6. t.bgcolor('black')
  7. t.color('lime')  #comment out for random colors
  8. d = 120
  9. colors = ["maroon","olive","blue","orange","purple","coral","khaki"]
  10. for i in range(140,0,-20):
  11.     d = d-20
  12.     for j in range(0,380,10):
  13.         #color = random.choice(colors)  #uncomment for random colors
  14.         #t.color(color)  #uncomment for random colors
  15.         #rndw = random.randint(2,5)  #uncomment for random widths
  16.         #t.width(rndw)  #uncomment for random widths
  17.         t.pu()
  18.         t.fd(i)
  19.         t.pd()
  20.         t.circle(d)
  21.         t.pu()
  22.         t.home()
  23.         t.rt(j)
  24. t.ht()
  25. t.exitonclick()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement