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 | |
|---|---|---|
| 1scores = [72, 85, 90, 64] | AIndex 4 is out of range. With zero-based indexing the valid indexes are 0 to 3, so the last element is scores[3]. | |
| 2scores[2] | BThe loop starts at 0 but the array is 1-based. The loop should run from 1 to 5 so every element is reached and no invalid index is used. | |
| 3Every element in a one-dimensional array should have the same data type | Cscores.append(78) | |
| 4A growing list can add an element, while a fixed-size array keeps the same number of elements | DReaches the third element of the array, 90, using index 2 (zero-based) | |
| 5scores = [72, 85, 90, 64]\nprint(scores[4]) | Enames = ["Ava", "Liam", "Mia"] | |
| 6FOR i FROM 0 TO 5 PRINT scores[i] (array has 5 elements, 1-based) | FCreates a one-dimensional array (list) of four integers named scores |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
one-dimensional array — A named, ordered collection of elements of the same data type. Each element is reached by its index, its position number (0-based in Python, often 1-based in pseudocode).scores = [85, 92, 78, 64]
print(scores[0])scores = [85, 92, 78, 64]
print(scores[3])scores = [85, 92, 78, 64]
count = len(scores)scores = [85, 92, 78, 64]
scores.append(70)scores = [85, 92, 78, 64]
scores[2] = 99