Meet a drawing turtle
Why is it called a turtle?
The turtle robot, a simple robot controlled from the user's workstation that is designed to carry out the drawing functions assigned to it using a small retractable pen set into or attached to the robot's body

A drawing turtle is going to have three attributes a location, an orientation (or direction), and a pen. The pen will have its own attributes: color, width, and on/off state.
When we program with a turtle, we are using body syntonic reasoning - in other words - we can predict and reason about the turtles movements by imagining what we would do if we were the turtle.
#creating a new drawing turtle named mock
mock = turtle.Turtle()
#moving mock forward 100 steps
mock.forward(100)
#mock is making a left hand turn at 60 degrees
mock.left(60)

This is sequential code! One line executes AFTER the one before it has finished.
The # are programmer comments that clarify the action
mock.forward()
Mock is the name of the object we created (mock is an instance of the turtle) and we are calling the method/function/procedure of forward. These methods already exist in the Python library.
mock.forward(100)
The 100 is the value passed into the method as an argument. - allowing us to use this method for any number of steps we want the turtle to take.
Last updated