Skip to content

Latest commit

 

History

History
67 lines (55 loc) · 853 Bytes

turtle-manual.md

File metadata and controls

67 lines (55 loc) · 853 Bytes

Turtle Graphics: Cheat Sheet

Get started:

import turtle

Draw a line, 100 pixels long:

turtle.forward(100)
turtle.back(100)

Change direction, right or left by 90 degrees:

turtle.right(90)
turtle.left(90)

Draw a circle, with radius 50 pixels:

turtle.circle(50)

Draw a semi-circle:

turtle.circle(50, 180)

Change the color:

turtle.pencolor("blue")

Change the pen size to 10 pixels:

turtle.pensize(10)

Erase everything and start over:

turtle.reset()

Send the turtle to center of the screen:

turtle.home()

Move the turtle without drawing:

turtle.penup()

Resume drawing when turtle moves:

turtle.pendown()

Make the turtle draw faster:

turtle.delay(0)