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 = [12, 15, 9, 20] | AThe elements are different data types (integer, string, float). An array must hold one data type only. | |
| 2for i in range(len(scores)): | Bnames = ["Ava", "Liam", "Mia"] | |
| 3Each item in an array is found by its index number, and the first index is 0 | Cprint(scores[0]) | |
| 4Every element in an array must be the same data type, such as all strings | DIndex 3 does not exist. The array has 3 items, so the valid indexes are 0, 1 and 2. | |
| 5temps = [21, "warm", 19.5] | ECreates a one-dimensional array of four integers using a Python list | |
| 6nums = [4, 8, 6] print(nums[3]) | FLoops through every index of the array, from 0 up to the last index |
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 single row of items of the same data type, stored under one name. Each item is found by its index number, starting at 0. In Python, a list is used as an array.scores = [12, 18, 15, 20]
print(scores[0])scores = [12, 18, 15, 20]
for i in range(len(scores)):
print(scores[i])scores = [12, 18, 15, 20]
size = len(scores)scores = [12, 18, 15, 20]
scores[2] = 99scores = [12, 18, 15, 20]
print(scores[len(scores) - 1])