Random Number Generation (OCR GCSE Computer Science): Quizzes

📚Quizzes
Random Number Generation
Sign up to keep practising.Create a free account to play more quizzes and track your progress.

Practise the questions

12 questions from this quiz

Show

What is random number generation?

Producing unpredictable numbers in a range

Which of these is a common use for random numbers in programming?

Games and simulations

Which Python module is used to generate random numbers?

random

What range does random.randint(1, 10) generate in Python?

Between 1 and 10

What range does random.random() generate in Python?

Between 0.0 and 1.0

Which Java class is used to generate random numbers?

Random

In pseudocode, what does RANDOM(1, 6) simulate?

Rolling a dice

Why are random numbers useful in programs?

They add unpredictability

What does random.randint(1, 2) simulate in a coin flip program?

Choosing between heads or tails

How many random numbers does [random.randint(1, 100) for _ in range(5)] generate?

5 random numbers

Which Python function shuffles items in a list randomly?

random.shuffle()

Which function generates a random integer within a range in Python?

random.randint()

Explore OCR GCSE Computer Science Revision Notes by Topics

Explore OCR GCSE Computer Science Model Answers by Topics

Explore OCR GCSE Computer Science Flashcards by Topics

Explore OCR GCSE Computer Science Exam Questions by Topics

Join 100,000+ GCSE students studying Quizzes with us.

Select your subjects, and get access to A+ resources today.