Standard difficulty · 20 questions · 40 marks · Time: 37 minutes
Show your working for Sections B and C. Answers are on the last page — try every question first!
Python Modules: math, random and statistics · AW-11CS-MOD-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.
| Q | Answer | Working |
|---|---|---|
| 1 | (d) a file of Python definitions that can be imported and used | — |
| 2 | (c) 20 | ceil() rounds up to a whole number (an int) |
| 3 | (a) 25 | randint(20, 24) gives a whole number from 20 to 24, both included |
| 4 | (d) 17 | sorted: 12, 13, 17, 17, 24, 26, 30 |
| 5 | (d) 10 9 9 | 67 / 7 = 9.571428571428571 |
| 6 | (c) print(math.fabs(18.5)) | import math brings in the module; each function is used as math.fabs(…) |
| 7 | (c) 9 | the values are 8, 10, 12, 14, 16, 18, 20, 22, 24 |
| 8 | (a) 27 | random() gives 0 ≤ r < 1, so int(r × 17) is 0 to 16 |
| 9 | import math brings in the module, so functions are used as math.sqrt(); from math import sqrt brings in only sqrt, used directly as sqrt(). | — |
| 10 | (a) −9; (b) 8.0 | 8.5 − 17 = −8.5; floor() goes down, to the more negative whole number; pow() always gives a float |
| 11 | (a) 19; (b) 20; (c) 20 | sum 95 ÷ 5; sorted: 5, 20, 20, 21, 29; mean of whole numbers prints without .0 only when it is exact, and the median of an even count is a float |
| 12 | (a) 23; (b) 68 | 3 × 5 + 8 and 12 × 5 + 8 |
| 13 | (a) 116.0; (b) 11 | 802 + 842 = 13456; int() drops the fraction of √121 |
| 14 | 15.0 | 4.0 + 11.0: both give floats |
| 15 | (a) 5; (b) 6 | 274 ÷ 56 ≈ 4.89, rounded up; then the empty seats |
| 16 | (a) 78; (b) 32 | π × 5 × 5 ≈ 78.54; 2 × π × 5 ≈ 31.42 |
| 17 | import math → math.sqrt(9); from math import sqrt → sqrt(9); from math import * → sqrt(9) and pi; import math as m → m.sqrt(9). | — |
| 18 | (a) 2827; (b) 189; (c) 30.0 | area ≈ 2827.43, circumference ≈ 188.5; sqrt() gives a float |
| 19 | (a) 18.571428571428573; (b) 15; (c) 14 | sum 130 ÷ 7; sorted: 6, 14, 14, 15, 24, 27, 30; 14 is the most common |
| 20 | (a) 2; (b) 12; (c) 11 | totals run from 1 + 1 to 7 + 5, every whole number in between |