1/26
Flashcards for Turtle Graphics Cheat Sheet in Python
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What does turtle.setup(width, height)
do?
Sets the window size in pixels.
What does turtle.title('Title')
do?
Sets the title of the turtle graphics window.
What does turtle.bgcolor('color')
do?
Sets the background color of the window.
What does turtle.done()
do?
Finishes turtle commands and keeps the window open.
What does t = turtle.Turtle()
do?
Creates a new turtle object.
What does t.forward(distance)
do?
Moves the turtle forward by the specified distance.
What does t.backward(distance)
do?
Moves the turtle backward by the specified distance.
What does t.right(angle)
do?
Turns the turtle clockwise by the specified angle.
What does t.left(angle)
do?
Turns the turtle counterclockwise by the specified angle.
What does t.setheading(angle)
do?
Points the turtle in an absolute direction (0 = east, 90 = north).
What does t.goto(x, y)
do?
Moves the turtle to the specified position (x, y).
What does t.penup()
do?
Lifts the pen, so no drawing occurs while moving.
What does t.pendown()
do?
Puts the pen down, resuming drawing.
What does t.pensize(size)
do?
Sets the thickness of the pen.
What does t.pencolor('color')
do?
Sets the pen (line) color.
What does t.fillcolor('color')
do?
Sets the color used to fill shapes.
What does t.dot()
do?
Draws a default-sized dot at the current position.
What does t.dot(size, 'color')
do?
Draws a colored dot of the given size.
What does t.circle(radius)
do?
Draws a full circle with the given radius.
What does t.circle(radius, extent)
do?
Draws a partial circle with the given radius and extent (in degrees).
What does t.begin_fill()
do?
Starts filling a shape.
What does t.end_fill()
do?
Ends and fills the shape with the fillcolor.
What do t.xcor()
and t.ycor()
do?
Returns the current x or y coordinate.
What does t.heading()
do?
Returns the current heading angle.
What does t.shape('turtle')
do?
Changes the turtle's appearance to a turtle.
What does t.hideturtle()
do?
Hides the turtle icon.
What does t.showturtle()
do?
Shows the turtle icon.