← AQA GCSE

Random numbers: AQA GCSE practice

Using the random module. 7 questions in the style of the AQA GCSE exam.

Sample questions

After `import random`, which values can `random.randint(1, 6)` return?

  1. 1, 2, 3, 4 or 5
  2. Any whole number from 1 to 6 inclusive
  3. Any decimal number between 1 and 6
  4. 0, 1, 2, 3, 4, 5 or 6

In AQA pseudo-code, `roll ← RANDOM_INT(1, 6)`. Which list shows every value roll could hold?

  1. 1, 2, 3, 4, 5, 6
  2. 2, 3, 4, 5
  3. 0, 1, 2, 3, 4, 5
  4. 1, 2, 3, 4, 5