Basic Turtle Commands
The turtle module has some basic turtle commands that you can use to control and draw with the my_turtle object we created above.
In this case my_turtle is the object we created using the Turtle class defined in the turtle module.
Lets take a look at some commands
- my_turtle.forward(distance) moves the turtle forward in the current direction by the specified distance.
- my_turtle.backward(distance) moves the turtle backward in the opposite direction by the specified distance.
- my_turtle.right(angle) rotates the turtle’s direction to the right by the specified angle (in degrees).
- my_turtle.left(angle) rotates the turtle’s direction to the left by the specified angle (in degrees).
- my_turtle.penup() lifts the pen off the canvas, ...