AmbifulWorksheets
Practice that never repeats
CBSE · Class 11 · Computer Science

Lists

Standard difficulty · 20 questions · 40 marks · Time: 39 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.
Lists in Python are:
  1. limited to numbers
  2. always sorted
  3. immutable like strings
  4. mutable: items can be changed in place
2.
What does this program print?
L = [58, 39, 40, 36, 27, 51]
print(L[-2:-1])
  1. [36]
  2. []
  3. [51, 27, 36, 40, 39, 58]
  4. [27]
3.
What does this program print?
L = [4, 10, 19]
print(L.append(34))
  1. None
  2. 34
  3. Error
  4. [4, 10, 19, 34]
4.
What does this program print?
L = [26, 13, 24, 17, 26, 21, 26]
print(L.count(26), L.index(26))
  1. 0 3
  2. 3 1
  3. 3 0
  4. 1 0
5.
What does this program print?
L = [24, 30, 28, 6, 26]
L.reverse()
print(L)
  1. [26, 6, 28, 30, 24]
  2. [26, 6, 28, 30]
  3. [24, 30, 28, 6, 26]
  4. [6, 28, 30, 24, 26]
6.
What does this program print?
L = [14, 16, 17]
print(L + [17])
  1. [31, 33, 34]
  2. [14, 16, 17, 17]
  3. [17, 14, 16, 17]
  4. [14, 16, 17, [17]]
7.
What does this program print?
M = [[31, 15, 8], [41, 45, 30], [44, 31, 46]]
print(M[2][::-1])
  1. [46, 31, 44]
  2. [8, 30, 46]
  3. [31, 46]
  4. [8, 15, 31]
8.
What does this program print?
a = [7, 10, 27]
b = a
b.append(39)
print(a)
  1. [7, 10, 27, 39, 39]
  2. [7, 10, 27, 39]
  3. [7, 10, 27]
  4. [39]
Section B — Short answer8 × 2 = 16 marks
9.
What is the difference between append() and extend()?
10.
What does this program print? Give (a) the first line (b) the second.
L = [17, 45, 32, 30, 33, 50, 53]
print(L[4:7:2])
print(L[3:6])
11.
What does this program print? Give the four lines (a) to (d).
L = [57, 89, 92, 66, 34]
print(len(L))
print(sum(L))
print(max(L))
print(min(L))
12.
What does this program print?
L = [15, 6, 14, 27]
L.sort()
L.append(59)
L.pop(0)
print(L)
13.
What does this program print?
L = [48, 13, 25, 96, 53, 19, 58]
key = 12
found = False
for i in range(len(L)):
    if L[i] == key:
        print('Found at index', i)
        found = True
        break
if not found:
    print('Not found')
14.
What does this program print? Give (a) the first line (b) the second.
L = [1, 15, 19, 18, 1, 27]
c = 0
for x in L:
    if x == 1:
        c = c + 1
print(c)
print(L.count(19) + len(L))
15.
What does this program print? Give (a) the first line (b) the second.
M = [[8, 3, 35], [18, 23, 10], [1, 21, 38]]
total = 0
for row in M:
    total = total + row[2]
print(total)
print(sum(M[1]))
16.
What does this program print?
L = [47, 9, 35, 15, 31, 38, 58, 39]
for i in range(0, len(L) - 1, 2):
    L[i], L[i + 1] = L[i + 1], L[i]
print(L)
Section C — Word problems4 × 4 = 16 marks
17.
Explain any six list methods with an example of each.
18.
What does this program print? Give the four lines (a) to (d).
L = [33, 19, 6, 27, 11]
L.append(45)
print(L[-1], len(L))
print(L.pop(1))
L.sort(reverse=True)
print(L[:3])
print(L.index(11), len(L))
19.
What does this program print? Give the three lines (a) to (c).
marks = [79, 49, 96, 55, 78, 31, 43, 54]
big = small = marks[0]
for m in marks:
    if m > big:
        big = m
    if m < small:
        small = m
print(big)
print(small)
print(sum(marks) / len(marks))
20.
What does this program print? Give (a) the first line (b) the second (c) the third.
a = [29, 3, 2]
b = a
c = a[:]
b.append(57)
c.append(42)
print(a)
print(c)
print(a == b, len(c))
AmbifulWorksheets
Practice that never repeats
CBSE · Class 11 · Computer Science

Answer key

Lists · AW-11CS-LST-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.

QAnswerWorking
1(d) mutable: items can be changed in place—
2(d) [27]start is included, stop is not; a negative index counts from the end
3(a) Noneappend() changes the list and gives back None
4(c) 3 0count() counts every match; index() gives the first
5(a) [26, 6, 28, 30, 24]reverse() turns the list round in place; it does not sort
6(b) [14, 16, 17, 17]+ joins two lists
7(a) [46, 31, 44]row 2, reversed
8(b) [7, 10, 27, 39]b = a makes b another name for the same list
9append() adds its argument as one item (even a whole list); extend() adds each item of the given list.—
10(a) [33, 53]; (b) [30, 33, 50]start is included, stop is not
11(a) 5; (b) 338; (c) 92; (d) 34len, sum, max and min of the list
12[14, 15, 27, 59]apply each method in turn
13Not found12 is not in the list
14(a) 2; (b) 71 appears 2 times; 19 appears 1 times and the list has 6 items
15(a) 83; (b) 51column 2: 35 + 10 + 38; row 1: 18 + 23 + 10
16[9, 47, 15, 35, 38, 31, 39, 58]items at even and odd positions swap in pairs; a last odd item stays
17append (adds one item), extend (adds items of a list), insert (adds at a position), remove (first match), pop (removes by index), sort (in place); e.g. [3, 1].sort() makes [1, 3].—
18(a) 45 6; (b) 19; (c) [45, 33, 27]; (d) 3 5each line uses the list as the lines before left it
19(a) 96; (b) 31; (c) 60.625mean = 485 ÷ 8; / gives a float
20(a) [29, 3, 2, 57]; (b) [29, 3, 2, 42]; (c) True 4b is the same list as a; c is a separate copy