Additional Programming Techniques (OCR GCSE Computer Science): Flashcards

📚Flashcards
Random Number Generation
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

12 cards from this deck

Show

What is random number generation?

Producing unpredictable numbers within a specified range

Common uses of random numbers in programming

Games, simulations, choosing random data from lists

Python module for generating random numbers

random module

Python function to generate random integer

random.randint()

Range of random.randint(1, 10) in Python

Between 1 and 10 inclusive

Python function for random float

random.random()

Range of random.random() output

Between 0.0 and 1.0

Java class for random number generation

Random class

Pseudocode: RANDOM(1, 6) simulates what?

Rolling a dice (number between 1 and 6)

Random numbers for decision-making example

Simulating coin flip (heads or tails)

Using random numbers to create simulated data

Generate/populate list with random values

Python function to shuffle list items randomly

random.shuffle()

Explore OCR GCSE Computer Science Revision Notes by Topics

Explore OCR GCSE Computer Science Model Answers by Topics

Explore OCR GCSE Computer Science Quizzes by Topics

Explore OCR GCSE Computer Science Exam Questions by Topics

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

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