Turtle Graphics Cheat Sheet

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/26

flashcard set

Earn XP

Description and Tags

Flashcards for Turtle Graphics Cheat Sheet in Python

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

27 Terms

1
New cards

What does turtle.setup(width, height) do?

Sets the window size in pixels.

2
New cards

What does turtle.title('Title') do?

Sets the title of the turtle graphics window.

3
New cards

What does turtle.bgcolor('color') do?

Sets the background color of the window.

4
New cards

What does turtle.done() do?

Finishes turtle commands and keeps the window open.

5
New cards

What does t = turtle.Turtle() do?

Creates a new turtle object.

6
New cards

What does t.forward(distance) do?

Moves the turtle forward by the specified distance.

7
New cards

What does t.backward(distance) do?

Moves the turtle backward by the specified distance.

8
New cards

What does t.right(angle) do?

Turns the turtle clockwise by the specified angle.

9
New cards

What does t.left(angle) do?

Turns the turtle counterclockwise by the specified angle.

10
New cards

What does t.setheading(angle) do?

Points the turtle in an absolute direction (0 = east, 90 = north).

11
New cards

What does t.goto(x, y) do?

Moves the turtle to the specified position (x, y).

12
New cards

What does t.penup() do?

Lifts the pen, so no drawing occurs while moving.

13
New cards

What does t.pendown() do?

Puts the pen down, resuming drawing.

14
New cards

What does t.pensize(size) do?

Sets the thickness of the pen.

15
New cards

What does t.pencolor('color') do?

Sets the pen (line) color.

16
New cards

What does t.fillcolor('color') do?

Sets the color used to fill shapes.

17
New cards

What does t.dot() do?

Draws a default-sized dot at the current position.

18
New cards

What does t.dot(size, 'color') do?

Draws a colored dot of the given size.

19
New cards

What does t.circle(radius) do?

Draws a full circle with the given radius.

20
New cards

What does t.circle(radius, extent) do?

Draws a partial circle with the given radius and extent (in degrees).

21
New cards

What does t.begin_fill() do?

Starts filling a shape.

22
New cards

What does t.end_fill() do?

Ends and fills the shape with the fillcolor.

23
New cards

What do t.xcor() and t.ycor() do?

Returns the current x or y coordinate.

24
New cards

What does t.heading() do?

Returns the current heading angle.

25
New cards

What does t.shape('turtle') do?

Changes the turtle's appearance to a turtle.

26
New cards

What does t.hideturtle() do?

Hides the turtle icon.

27
New cards

What does t.showturtle() do?

Shows the turtle icon.