cs100 2014F Lecture 02 Turtles
cs100 2014F Lecture 02 Turtles
Fall 2014
Lecture 02: Fun With Turtles
Introduction to Computing Using Python
Screen
constructor >>> import turtle
>>> aScreen = turtle.Screen()
>>> shelly = turtle.Turtle()
Turtle
constructor
Introduction to Computing Using Python
Moving a Turtle
A Fancier Turtle
>>> shelly.color('blue')
>>> shelly.width(10)
Introduction to Computing Using Python
blueT = Turtle()
blueT.color('blue')
blueT.width(10)
blueT.forward(100)
blueT.right(120)
blueT.forward(100)
blueT.right(120)
blueT.forward(100)
blueT.right(120)
Introduction to Computing Using Python