Search Header Logo

Random Functions and Turtle Graphics Quiz

Authored by Fadi Fadi

Information Technology (IT)

10th Grade

Used 9+ times

Random Functions and Turtle Graphics Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the random.randint(2, 8) function do?

Generates a random float between 2 and 8

Generates a random integer between 2 and 8 (inclusive)

Generates a random integer between 2 and 7

Always returns 5

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which import statement is correct for using random.randint?

from math import randint

import randint

import random

from os import random

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will random.randint(1, 1) return?

1

A random integer between 0 and 1

An error

None

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is invalid?

random.randint(5, 10)

random.randint(10, 5)

random.randint(1, 100)

random.randint(-5, 5)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the random module?

To generate random images

To generate random numbers or choices

To shuffle lists alphabetically

To perform mathematical calculations

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does pen.penup() do?

Moves the pen up and stops drawing

Lowers the pen to start drawing

Moves the turtle backward

Rotates the turtle

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you make the turtle move 50 units forward?

turtle.move(50)

pen.forward(50)

pen.up(50)

turtle.left(50)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?