Turtle CheatSheet
Code | Result |
import turtle | Call the turtle function (must have this line only once) |
wn=turtle.Screen(800,800) | Screen size (800 x 800 px) [px = pixles] |
wn.bgcolor("light green") | Screen color |
t=turtle.Turtle | Name the turtle "t" (can have turtles with different names) |
t.shape("turtle") | Cursor shape (turtle, circle, square, triangle, arrow) |
t.width(2) | Line width (px) |
t.color ("blue") | Line color |
t.speed(20) | Speed of drawing |
. | |
t.forward (100) | Move forward 100 px |
t.left (90) | Turn left 90 degrees |
t.right (45) | Turn right 45 degrees |
t.backward(50) | Moves the turtle backward 50px |
t.up(.) | Sets the pen state to be up - not drawing when moving |
t.down(.) | Sets the pen state to be down - drawing when moving |
t.circle(80) | Draws a circle of the indicated radius - 80px |
t.goto(x,y) | Go to the x,y position on the grid |
. | |
for x in range(4): |
Loop: Repeats the indented lines 4 times * Only indented lines are included in the loop |
Last modified: Monday, 1 September 2025, 4:01 PM