Chapter Opener Photo

APPENDIX C

turtle Reference

The definitive guide to the turtle module can be found at http://docs.python.org/3.8/library/turtle.html.

C.1 Basic Move and Draw

  • forward(distance) Move forward along the current heading by distance units.

  • backward(distance) Move backward along the current heading by distance units.

  • right(angle) Turn the turtle right by angle degrees.

  • left(angle) Turn the turtle left by angle degrees.

  • goto(pos, y=None) Move the turtle to an absolute position. If the tail is down, then a line will be drawn. The turtle’s orientation does not change. The position may be specified by a pair of numbers, or a tuple representing ...

Get Python Programming in Context, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.