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 | |
|---|---|---|
| 1score = 0 | AA library: ready-made code that is brought into the program so you can reuse it | |
| 2import random | BThe variable total is used before it has been given a value, so Python cannot find it. | |
| 3A control structure decides which code runs or how many times it repeats | CA variable: a named place that stores a value the program can use and change | |
| 4A data structure stores a collection of related values under one name | Dfor i in range(5): print(i) | |
| 5if score > 50 print("Pass") | ESyntax error: the if line is missing its colon at the end. Syntax is the set of rules the code must follow. | |
| 6print(total) total = 10 | Fscores = [88, 74, 91] |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
five features of programming — Every program is built from five features: variables, control structures, data structures, syntax, and libraries and classes.score = 10
print(score)lives = 3
while lives > 0:
lives = lives - 1names = ["Ava", "Liam", "Mia"]
print(names[0])age = 16
if age == 16:
print("Year 11")import random
print(random.randint(1, 6))