Year 8 · Quiz 2

One-dimensional arrays (lists)

10 multiple-choice questions on lists, indexes, len, append, looping, counting, totaling and max. Matches Parts 2–6 of the Year 8 Python tutorial.

Predict output Fill blanks Find errors
Indexes

Question 1

In Python, list indexes start at ___.

Choose one answer
Predict the output

Question 2

What is printed?

scores = [8, 5, 9, 7, 6]
print(scores[0])
print(scores[2])
Choose one answer
Predict the output

Question 3

scores = [8, 5, 9, 7, 6]
scores[1] = 10
print(scores)
Choose one answer
Fill in the blank

Question 4

To find how many items are in a list, use:

print(___(scores))
Choose one answer
Predict the output

Question 5

names = ["Aisha", "Ben"]
names.append("Chloe")
print(names)
Choose one answer
Find the error

Question 6

For scores = [8, 5, 9, 7, 6], which access is unsafe?

Choose one answer
Predict the output

Question 7

What is the final value of total?

scores = [8, 5, 9]
total = 0
for score in scores:
    total = total + score
print(total)
Choose one answer
Counting

Question 8

How many scores are 7 or more?

scores = [8, 5, 9, 7, 6]
count = 0
for score in scores:
    if score >= 7:
        count = count + 1
print(count)
Choose one answer
Maximum

Question 9

What is printed?

scores = [8, 5, 9, 7, 6]
biggest = scores[0]
for score in scores:
    if score > biggest:
        biggest = score
print(biggest)
Choose one answer
Fill in the blank

Question 10

To visit every index safely, complete:

for i in range(___(scores)):
    print(scores[i])
Choose one answer

Previous: Quiz 1 · Year 8 Python · All quizzes