Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1if 1 <= age <= 120: | AUses < instead of <=, so the boundary values 1 and 120 are wrongly rejected when the range should be inclusive. | |
| 2if MIN_AGE <= age <= MAX_AGE: | BChecks that age is between 1 and 120, including both limits | |
| 3Inclusive boundaries: the minimum and maximum values themselves are accepted | Cvalid = 1 <= mark <= 100 | |
| 4A range check on a date: the date must fall between a start date and an end date | DRange check that uses named constants for the lower and upper limits | |
| 5if 1 < age < 120: | Eif date(2025, 1, 1) <= entry <= date(2025, 12, 31): | |
| 6if age >= 1 or age <= 120: | FUses or instead of and, so almost every number passes, including 0 and 121. Both limits must be satisfied together. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
1 <= age <= 120 — A range check: tests that a number lies between a minimum and a maximum (inclusive here). Values outside the limits, such as 0 or 121, are rejected as invalid.if 1 <= age <= 120:
print("Valid age")LOW = 1
HIGH = 120
if LOW <= age <= HIGH:entry = "2026-06-15"
if "2026-01-01" <= entry <= "2026-12-31":if age < 1 or age > 120:
print("Invalid age")age = int(input("Age: "))
while not 1 <= age <= 120:
age = int(input("Try again: "))