Fork me on GitHub

Erin H's First Turtle

by Erin Holmes

09 Sep 2013

For my first turtle, I made the Olympic rings. I'm hoping to avoid litigation from the IOC since I'm using it for educational purposes. My code and a link to the screenshot are below.

#olympic rings
import turtle

edward = turtle.Turtle()
edward.pensize(10)
edward.color('white')
edward.setpos(-150,0)


for color in ['blue', 'black', 'red']:
  edward.color(color)
  edward.circle(75)
  edward.penup()
  edward.forward(175)
  edward.pendown()

edward.penup()
edward.setpos(-65,-95)
edward.pendown()

for color in ['yellow', 'green']:
  edward.color(color)
  edward.circle(75)
  edward.penup()
  edward.forward(175)
  edward.pendown()

turtle.done()

Olympic Rings Screenshot

Source: Python Turtle Library Documentation: http://docs.python.org/2/library/turtle.html

Erin is a second year MSIS student and is trying her best at life! She hopes to be a git rockstar in about 3 months! Find Erin Holmes on Twitter, Github, and on the web.
comments powered by Disqus