Random numbers: OCR GCSE practice
Using the random module. 7 questions in the style of the OCR GCSE exam.
Sample questions
After `import random`, which values can `random.randint(1, 6)` return?
- 1, 2, 3, 4 or 5
- Any whole number from 1 to 6 inclusive
- Any decimal number between 1 and 6
- 0, 1, 2, 3, 4, 5 or 6
In OCR Exam Reference Language, `roll = random(1, 6)`. Which value could NOT be stored in `roll`?
- 6
- 0
- 3
- 1