AmbifulWorksheets
Practice that never repeats
CBSE · Class 9 · Computational Thinking and AI

Python Lists

Standard difficulty · 20 questions · 40 marks · Time: 40 minutes

Name: Date: Score: ____ / 40

Show your working for Sections B and C. Answers are on the last page — try every question first!

Section A — Choose the correct answer8 × 1 = 8 marks
1.
The first item of a Python list has index:
  1. −1
  2. it has no index
  3. 1
  4. 0
2.
What does this print?
a = [78, 81, 73, 55, 75, 72]
print(a[4])
  1. 55
  2. 72
  3. 75
  4. 4
3.
What does this print?
a = [16, 38, 14, 59, 3]
print(a[-4])
  1. 59
  2. 3
  3. 38
  4. 16
4.
What does this print?
a = [46, 47, 50, 97, 67, 83, 11]
print(a[2:4])
  1. [97]
  2. [50, 97]
  3. [47, 50, 97]
  4. [97, 50]
5.
What does this print?
a = [41, 5, 49, 48, 61, 29, 7]
a.pop()
a.pop()
a.pop()
print(len(a))
  1. 4
  2. 5
  3. 7
  4. 3
6.
What does this print?
names = ['Zoya', 'Dev', 'Vikram', 'Ananya']
names.remove('Dev')
names.append('Asha')
names.pop(1)
print(names)
  1. ['Zoya', 'Vikram', 'Asha']
  2. ['Zoya', 'Ananya', 'Asha']
  3. ['Zoya', 'Vikram', 'Ananya', 'Asha']
  4. ['Asha', 'Ananya', 'Zoya']
7.
What does this print?
a = [31, 17, 60, 62, 34, 37]
a.pop()
a.insert(4, 71)
print(min(a))
  1. 17
  2. 6
  3. 18
  4. 16
8.
What does this print?
a = [39, 36, 3, 6, 21]
a.sort()
print(a[4])
  1. 39
  2. 21
  3. 3
  4. 36
Section B — Short answer8 × 2 = 16 marks
9.
What is a list in Python? Give an example.
10.
For a = [27, 35, 90, 64, 61, 67, 65], what are (a) a[6] (b) a[-4]?
11.
For a = [86, 6, 39, 42, 60, 14, 58, 90], write the items of a[2:7], separated by commas.
12.
What is in a at the end? Write the items separated by commas.
a = [56, 63, 10, 36, 65]
a.insert(1, 13)
a.pop()
a.pop()
13.
How many items does a have at the end?
a = [2, 59, 12, 27, 33]
a.append(80)
a.append(97)
a.insert(6, 86)
a.insert(0, 20)
14.
What does this print?
a = [87, 76, 75, 64, 90, 94, 19]
print(a.index(90))
15.
What is in a after this runs? Write the items separated by commas.
a = [4, 8, 12, 16, 20]
for i in range(len(a)):
    a[i] = a[i] + 2
16.
What is in names at the end? Write the names separated by commas.
names = ['Dev', 'Meera', 'Rahul', 'Ananya', 'Priya']
names.remove('Dev')
names.append('Arjun')
names.pop(1)
Section C — Word problems4 × 4 = 16 marks
17.
Create a list of children selected for a quiz, then delete one name, add one at the end and remove the item at the second position. Explain each step.
18.
num = [19, 77, 41, 66, 54, 51]. What is printed by (a) print(len(num)) (b) print(num[1:4]) (c) print(num[-4:-1])? For (b) and (c), write the items separated by commas.
19.
What is printed?
list1 = [19, 43, 22, 34]
list1.extend([10, 16, 37])
list1.sort()
print(list1)
print(len(list1))
print(list1[0] + list1[-1])
Give (a) the items of the list, separated by commas (b) the length (c) the last line.
20.
What is printed?
marks = [36, 74, 75, 33, 95]
print(sum(marks))
print(max(marks))
count = 0
for m in marks:
    if m >= 60:
        count = count + 1
print(count)
Give (a) to (c) in order.
AmbifulWorksheets
Practice that never repeats
CBSE · Class 9 · Computational Thinking and AI

Answer key

Python Lists · AW-9CT-PYL-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.

QAnswerWorking
1(d) 0—
2(c) 75indexes start at 0: a[4] is item 5
3(c) 38a[-4] counts 4 from the end
4(b) [50, 97]from index 2 up to, not including, 4
5(a) 4append and insert add one item; remove and pop take one away
6(b) ['Zoya', 'Ananya', 'Asha']after remove and append: ['Zoya', 'Vikram', 'Ananya', 'Asha']; pop(1) removes index 1
7(a) 17a is now [31, 17, 60, 62, 71, 34]
8(a) 39sorted: [3, 6, 21, 36, 39]
9An ordered collection of items in square brackets, e.g. marks = [78, 92, 65].—
10(a) 65; (b) 64indexes start at 0; negative indexes count from the end
1139, 42, 60, 14, 58indexes 2 to 6
1256, 13, 63, 10carry out each line in turn
139a ends as [20, 2, 59, 12, 27, 33, 80, 86, 97]
14490 is item 5, so its index is 4
156, 10, 14, 18, 22add 2 to each item
16Meera, Ananya, Priya, Arjunpop(1) removes the item at index 1
17q = ["Arjun", "Isha", "Kabir", "Meera"]; q.remove("Kabir"); q.append("Jay"); q.pop(1) removes the item at index 1; print(q).—
18(a) 6; (b) 77, 41, 66; (c) 41, 66, 54num[1:4] is the 2nd to 4th items; num[-4:-1] is the 3rd to 5th
19(a) 10, 16, 19, 22, 34, 37, 43; (b) 7; (c) 53extend adds every item; sort puts them in order
20(a) 313; (b) 95; (c) 3marks at least 60: 74, 75, 95