Turtle graphics Flashcards
The following Python code will draw a U shape (facing up):
turtle. setheading(180)
turtle. forward(50)
turtle. circle(50,180)
turtle. forward(50)
turtle. setheading(90)
turtle. forward(50)
turtle. circle(50,180)
turtle. forward(50)
turtle. setheading(270)
turtle. forward(50)
turtle. circle(50,180)
turtle. forward(50)
turtle. forward(50)
turtle. circle(50,180)
turtle. forward(50)
turtle. setheading(270)
turtle. forward(50)
turtle. circle(50,180)
turtle. forward(50)
Python turtle can draw an arc by using the ________ function.
curve
circle
arrow
arc
circle
The following code will ________.
turtle.goto(10, 20)
draw a line from the current position with a length of 20 and an angle of 10
draw a line from the current position with a length of 10 and an angle of 20
move the turtle to the point with coordinates x = 10, y = 20
move the turtle to the point with coordinates x = 20, y = 10
move the turtle to the point with coordinates x = 10, y = 20
Which of the following will hide the turtle if it is visible?
if turtle.isvisible():
turtle.invisible()
if turtle.isvisible():
turtle.hideturtle()
if turtle.isvisible
turtle.hideturtle()
turtle. isvisible():
turtle. hide()
if turtle.isvisible():
turtle.hideturtle()
In order to draw an octagon with turtle graphics, you would need a loop that iterates eight times.
TRUE
FALSE
TRUE
The correct syntax to set the turtle’s pen colour to blue is
turtle.pen().color = BLUE
setcolor(turtle.pen, ‘blue’)
turtle.pencolor(‘blue’)
turtle.color = ‘blue’
turtle.pencolor(‘blue’)
Which of the following functions can be used to make decisions while drawing?
turtle. begin_fill()
turtle. penup()
turtle. forward()
turtle. fillcolor()
turtle.fillcolor()
The following Python code will draw a ________.
for x in range(4):
turtle. forward(50) turtle. right(90)
pentagon
right triangle
hexagon
square
square
Turtle graphic functions are built-in Python functions that are always available to use without importing.
TRUE
FALSE
FALSE
Which of the following will check if the turtle’s pen is up and will change it to down if that is the case?
if not(turtle.penup()) turtle.penup()
if turtle.isdown
turtle.penup()
if turtle.isup():
turtle.isdown()
if not(turtle.isdown()): turtle.pendown()
if not(turtle.isdown()): turtle.pendown()
The following statement will check to see if the turtle’s pen color is ‘green’:
if turtle.pencolor() = ‘green’
TRUE
FALSE
FALSE
The following code snippet will change the turtle’s pen size to 4 if it is presently less than 4:
if turtle.pensize() < 4:
turtle.pensize(4)
TRUE
FALSE
TRUE
To use Python’s turtle graphics, you must include which of the following statements in your program?
import Turtle import turtle import turtle_module import turtle_graphics
import turtle
The Python turtle is initially positioned in the __________ of a graphics window and it first appears, by default, to be heading __________.
top left corner, east
center, east
center, up
bottom left corner, down
center, east
The turtle.isdown() function returns a(n) ______.
boolean
integer
string
float
boolean