Turtle

Turtle is a turtle that walks across the canvas with a pen and draws as it goes. The commands are the same as in Python’s turtle module. The center is (0, 0), y grows upwards.

Two ways to write it

import turtle
t = turtle.Turtle()
then t.forward(50) – works with several turtles
from turtle import *then forward(50) – short, for the beginning

The most important commands

forward(n)n steps forward, back(n) backwards
left(degrees)turn left, right(degrees) to the right
goto(x, y)straight to the point (x, y)
penup()lift the pen, pendown() to lower it
pencolor("red")color of the pen
pensize(n)thickness of the line
circle(n)circle with radius n
speed(0)speed 1 (slow) to 10, 0 = instant

Below the drawing in the editor this list can be opened, matching the way the program is written. All commands – filling, text, keys and clicks too – are in the command reference.