Turtle graphics Flashcards

1
Q

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)

A

turtle. setheading(270)
turtle. forward(50)
turtle. circle(50,180)
turtle. forward(50)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Python turtle can draw an arc by using the ________ function.

curve
circle
arrow
arc

A

circle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

move the turtle to the point with coordinates x = 10, y = 20

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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()

A

if turtle.isvisible():

turtle.hideturtle()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In order to draw an octagon with turtle graphics, you would need a loop that iterates eight times.

TRUE
FALSE

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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’

A

turtle.pencolor(‘blue’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following functions can be used to make decisions while drawing?

turtle. begin_fill()
turtle. penup()
turtle. forward()
turtle. fillcolor()

A

turtle.fillcolor()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The following Python code will draw a ________.

for x in range(4):

turtle. forward(50)
turtle. right(90)

pentagon
right triangle
hexagon
square

A

square

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Turtle graphic functions are built-in Python functions that are always available to use without importing.

TRUE
FALSE

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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()
A
if not(turtle.isdown()):
    turtle.pendown()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The following statement will check to see if the turtle’s pen color is ‘green’:
if turtle.pencolor() = ‘green’

TRUE
FALSE

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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
A

import turtle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

center, east

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The turtle.isdown() function returns a(n) ______.

boolean
integer
string
float

A

boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly