Fork me on GitHub

Dave's Tangential Circles

by David Pcolar

09 Sep 2013

For this assignment, I expermented with sizes and fills of circles. The code uses random numbers in a range to select the colors.

# Tangential Circles of random colors

import turtle
from random import randint

graphic = turtle.Turtle()
color_list = ['red','orange','yellow','green','violet','brown','blue','gray']

for circle_size in range(135,15,-15):
    pencolor = color_list[randint(0,7)]
    fillcolor = color_list[randint(0,7)]
    graphic.color(pencolor,fillcolor)

    if circle_size%2 is 0:
      graphic.fill(True)
    else:
      graphic.fill(False)
    graphic.pensize(randint(1,4))
    graphic.circle(circle_size)

turtle.done()

alternately filled tangential circles

Dave is an IT professional with the University Library. My focus is infrastructure related project management and research on scalable storage environments. Find David Pcolar on Twitter, Github, and on the web.
comments powered by Disqus