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 | |
|---|---|---|
| 1print("Start") print(Hello) print("End") | ARun -> error on line 3 -> fix line 3 -> run again | |
| 2Line 2 has an error, line 5 has an error | BThe interpreter reports only the line 2 error. The line 5 error stays hidden until line 2 is fixed. | |
| 3Lines before the error have already run, so their output appears before the error message | CThis describes a compiler, not an interpreter. An interpreter stops at the first error and reports only that one. | |
| 4After the interpreter stops at an error, you fix it and run the program again to find the next error | Dprint("A") print("B") print(C | |
| 5An interpreter lists every error in the whole program at once before running any code. | EAn interpreter does not carry on after an error. It halts at line 4, so lines 5 to 10 do not run. | |
| 6The interpreter hits an error on line 4, so it skips line 4 and carries on running lines 5 to 10. | FThe interpreter prints Start, then stops at line 2 with an error. The last line never runs. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
stops at first error — An interpreter runs code line by line and halts at the first error it finds, reporting only that one. Earlier lines have already run. Later errors stay hidden until you fix it and run again.print("Start")
x = 10 / 0 # interpreter stops here
print("End") # never runsname = "Sam"
print(name) # runs before the error
print(age) # error: age not definedx = 10 / 0 # error 1: shown first
y = int("abc") # hidden until error 1 fixederrors = 3
while errors > 0:
errors = errors - 1 # fix, run againfor n in range(1, 6):
if n == 3: # error found on line 3
break # stop, later lines never run