Fork me on GitHub

Meet Sophie the turtle!

by Sarah Breen

09 Sep 2013

Hello all - meet Sophie. Below, you will find the code I used to create Sophie the turtle. I wanted to experiment using multiple colors (including a background color) as well as making a few types of shapes.

The initial lines got me started, and after drawing a cicle, I felt it necessary to close the triangle I started making. I borrowed some code from this site to create the spiral. I played and manipulated how long it is, how wide it spirals and how far apart each dot is before settling on this one.

Sophie the turtle]

Code here:

import turtle

wn = turtle.Screen()
wn.bgcolor("skyblue")
sophie = turtle.Turtle()
sophie.color("darkblue")      
sophie.pensize(3)          
sophie.forward(50)
sophie.left(120)
sophie.forward(50)
sophie.color("violet")
sophie.circle(75)
sophie.color("darkblue")
sophie.left(120)
sophie.forward(50)

sophie.penup()               
size = 20
for i in range(30):
   sophie.stamp()           
   size = size + 3        
   sophie.forward(size)      
   sophie.right(25)

turtle.done()
Sarah is a first year MSIS student. Originally from Ohio, she has spent the last five years in Asia working in archives and as a project manager for several small organizations. Reach her on email at sburnham5@gmail.com. Find Sarah Breen on Twitter, Github, and on the web.
comments powered by Disqus