Python Flashcard 13 ( Random and Turtle Module)

Python Flashcard 13 ( Random and Turtle Module)

Assessment

Flashcard

Other

6th - 8th Grade

Hard

Created by

Quizizz Content

FREE Resource

Student preview

quiz-placeholder

8 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What does the random.randint(a, b) function do in Python?

Back

Generate a random integer between a (inclusive) and b (inclusive).

2.

FLASHCARD QUESTION

Front

Which function is used to move the turtle forward by a specified number of units in the turtle module?
a. turtle.move()
b. turtle.forward()
c. turtle.go()
d. turtle.draw()

Back

turtle.forward()

3.

FLASHCARD QUESTION

Front

Which function is used to shuffle the elements of a list randomly using the random module?
a. random.shuffle()
b. random.choice()
c. random.sample()
d. random.randrange()

Back

random.shuffle()

4.

FLASHCARD QUESTION

Front

What is the purpose of the random.seed() function in the random module?

Back

It resets the random number generator to a specific seed value.

5.

FLASHCARD QUESTION

Front

What is the primary purpose of the turtle module in Python?
Options:
a. Drawing graphics and creating visual designs.
b. Generating random numbers.
c. Working with databases.
d. Web scraping.

Back

Drawing graphics and creating visual designs.

6.

FLASHCARD QUESTION

Front

What does the turtle.pendown() function do?

Back

Lowers the turtle's pen to draw on the screen.

7.

FLASHCARD QUESTION

Front

Which function is used to close the turtle graphics window when you are done with drawing?
Options:
a. turtle.close()
b. turtle.exit()
c. turtle.done()
d. turtle.end()

Back

turtle.done()

8.

FLASHCARD QUESTION

Front

What is the purpose of the turtle.color() function in the turtle module?
Options: a. Changes the color of the turtle's shell.
b. Sets the background color of the graphics window.
c. Sets the color of the turtle's pen for drawing.
d. Changes the color of the turtle's eyes.

Back

Sets the color of the turtle's pen for drawing.