4.9. Summary of Turtle Methods¶
Method |
Parameters |
Description |
---|---|---|
Turtle |
None |
Creates and returns a new turtle object |
forward |
distance |
Moves the turtle forward |
backward |
distance |
Moves the turle backward |
right |
angle |
Turns the turtle clockwise |
left |
angle |
Turns the turtle counter clockwise |
up |
None |
Picks up the turtles tail |
down |
None |
Puts down the turtles tail |
color |
color name |
Changes the color of the turtle’s tail |
fillcolor |
color name |
Changes the color of the turtle will use to fill a polygon |
heading |
None |
Returns the current heading |
position |
None |
Returns the current position |
goto |
x,y |
Move the turtle to position x,y |
begin_fill |
None |
Remember the starting point for a filled polygon |
end_fill |
None |
Close the polygon and fill with the current fill color |
dot |
None |
Leave a dot at the current position |
stamp |
None |
Leaves an impression of a turtle shape at the current location |
shape |
shape name |
Should be ‘arrow’, ‘classic’, ‘turtle’, ‘circle’ or ‘square’ |
Once you are comfortable with the basics of turtle graphics you can read about even more options on the Python Docs Website. Note that we will describe Python Docs in more detail in the next chapter.
Note
This workspace is provided for your convenience. You can use this activecode window to try out anything you like.
Before you keep reading...
Making great stuff takes time and $$. If you appreciate the book you are reading now and want to keep quality materials free for other students please consider a donation to Runestone Academy. We ask that you consider a $10 donation, but if you can give more thats great, if $10 is too much for your budget we would be happy with whatever you can afford as a show of support.