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("Hi" | ASyntax error: the colon is missing after the condition. The translator reports it and shows the line before the program runs. | |
| 2result = 10 / 0 | Bpritn("Score") | |
| 3A misspelt keyword breaks the rules of the language, so the translator reports a syntax error | CA run-time error: the code is valid, but the program crashes when this line runs | |
| 4A logic error gives the wrong output but no error message, because the code follows the rules | DA syntax error: the closing bracket is missing, so the translator reports the error and its line number | |
| 5if age > 18 print("Adult") | Eaverage = a + b / 2 | |
| 6total = 5 print(totl) | FRun-time error: the variable name is misspelt, so the program stops when this line runs. The fix is to type total. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
syntax error — Code that breaks the rules of the language, like a missing bracket. The translator reports it and its line. A run-time error only occurs when the program runs.# "iff x > 5:" is a syntax error
if x > 5:
print("Big")print("Total"
# Translator reports: syntax error, line 1a = 10
b = 0
print(a / b) # run-time errorprint(10 / 0) # run-time error, not syntax# Want the average of 4 and 6
print(4 + 6 / 2) # logic error: prints 7