
J277 - 2.2 - Random Number Generation
Authored by R Eveleigh
Computers
10th Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of random number generation in programming?
To create predictable sequences of numbers
To simulate randomness in applications
To sort numbers in ascending order
To convert numbers to strings
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which Python module is commonly used for generating random numbers?
math
random
statistics
numpy
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you generate a random integer between 1 and 10 using the random module in Python?
`random.random(1, 10)`
`random.randint(1, 10)`
`random.range(1, 10)`
`random.int(1, 10)`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function from the random module would you use to select a random element from a list?
`random.choice()`
`random.select()`
`random.pick()`
`random.element()`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If you have a list `fruits = ['apple', 'banana', 'cherry', 'date']`, which of the following code snippets will randomly select a fruit from the list?
`random.choice(fruits)`
`random.randint(fruits)`
`random.random(fruits)`
`random.select(fruits)`
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following functions from the random module can be used to shuffle a list in place?
`random.shuffle()`
`random.mix()`
`random.scramble()`
`random.reorder()`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you generate a random floating-point number between 0 and 1 using the random module?
`random.uniform(0, 1)`
`random.random()`
`random.float()`
`random.rand()`
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Quiz-AIML
Quiz
•
University
10 questions
Asesmen Sumatif
Quiz
•
11th Grade
10 questions
Las Consultas en Bases de Datos
Quiz
•
10th Grade
13 questions
INTERNET CONNECTION
Quiz
•
12th Grade
13 questions
ICT and Retail Industry
Quiz
•
8th - 12th Grade
10 questions
Python with DataScience
Quiz
•
7th Grade - University
9 questions
Rounding Numbers in Python
Quiz
•
University
10 questions
Podstawy Pythona
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade