What is the output of random.randint(2, 8)?

Python Random and Turtle Quiz

Quiz
•
Information Technology (IT)
•
9th Grade
•
Easy
Fadi Fadi
Used 1+ times
FREE Resource
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A random integer between 2 and 7
A random float between 2 and 8
A random integer between 2 and 8 (inclusive)
Always returns 5
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is the correct way to import the random module to use randint?
import randint
from os import random
import random
from math import randint
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens when random.randint(1, 1) is executed?
Returns 1
Returns None
Raises an error
Returns a random number between 0 and 1
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these random.randint() calls is invalid?
random.randint(1, 100)
random.randint(5, 10)
random.randint(-5, 5)
random.randint(10, 5)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the primary use of the random module?
Sorting lists alphabetically
Generating random numbers or selections
Creating random images
Performing mathematical calculations
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does pen.penup() do in the Turtle module?
Moves the turtle backward
Lowers the pen to start drawing
Lifts the pen to stop drawing
Rotates the turtle
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which command correctly moves the turtle forward by 50 units?
pen.forward(50)
pen.up(50)
turtle.left(50)
turtle.move(50)
Create a free account and access millions of resources
Similar Resources on Quizizz
35 questions
ms excel kelas 6

Quiz
•
6th Grade - University
40 questions
3rd quarter test in ICT 10

Quiz
•
9th Grade
39 questions
Latihan Soal Informatika Kelas 9

Quiz
•
9th Grade
38 questions
7-20

Quiz
•
7th Grade - University
40 questions
Python Random and Turtle Quiz

Quiz
•
9th Grade
35 questions
Python alapok gyakorló

Quiz
•
9th - 12th Grade
39 questions
Y10 revisionr

Quiz
•
9th Grade - University
41 questions
Computer Apps Final Exam

Quiz
•
9th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Information Technology (IT)
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University