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 | |
|---|---|---|
| 1Interpreter: run line 1, run line 2, run line 3 | AAn interpreter does not compile the whole program first. It runs the code line by line, so there is no wait before testing. | |
| 2Line 4 error -> interpreter stops at line 4 | Bprint("Hello") # lines 1-2 only, rest not written yet | |
| 3An interpreter lets you test part of a program before it is finished | CAn interpreter can run an unfinished program, so part of it can be tested before the rest is written. | |
| 4The same source code can run on any machine that has an interpreter | DExecution halts at the faulty line, so the programmer can see exactly where the error is | |
| 5Interpreter: the whole program must be compiled first, so wait before testing | EWindows + interpreter, Mac + interpreter, Linux + interpreter -> same source code | |
| 6Interpreter: the program cannot be tested until every line has been written | FRuns the program straight away with no wait for compilation, so a programmer can test changes at once |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
interpreter — Runs code line by line with no wait to compile, so unfinished programs can be tested at once. It stops at the faulty line, making errors easy to find. Source code runs on any machine with one.# Test this part now, the rest is unfinished
def add(a, b):
return a + bprint("Line 1 runs")
print(10 / 0)
print("Never reached")# No compile step: run it straight away
python game.pytotal = 5 + 3
print(total)
# TODO: add the tax calculation later# Run now: it stops at any faulty line
age = int(input("Age: "))
print(age)