Activity
Last updated
Was this helpful?
Last updated
Was this helpful?
Command
Description
turtle.forward(distance)
Move the turtle forward by the specified distance, in the direction the turtle is headed.
turtle.backward(distance)
Move the turtle backward by distance, opposite to the direction the turtle is headed.
turtle.home()
Move turtle to the origin – coordinates (0,0) – and set its heading to its start-orientation.
turtle.penup()
Pull the pen up – no drawing when moving.
turtle.pendown()
Pull the pen down – drawing when moving.
turtle.pencolor(colorstring)
Set pencolor to colorstring (default colorstring is "black")
Examples:
turtle.pencolor("red")
turtle.pencolor("blue")
turtle.pencolor("yellow")
turtle.pencolor("blue")
turtle.pencolor("black")
turtle.pencolor("green")
turtle.circle(radius)
Draw a circle with given radius.
turtle.circle(radius, extent)
Draw a circle with given radius and extent – an angle – determines which part of the circle is drawn.
turtle.shape("turtle")
Sets the turtle shape to turtle.
turtle.undo()
Undo (repeatedly) the last turtle action(s)
turtle.clear()
Erases all drawings that currently appear in the graphics window.
turtle.begin_fill()
Starts the fill color
turtle.fillcolor(colorstring)
Examples:
turtle.fillcolor("red")
turtle.fillcolor("blue")
turtle.fillcolor("yellow")
turtle.fillcolor("blue")
turtle.fillcolor("black")turtle.fillcolor("green")
turtle.end_fill()
Ends the fill color