Computational Thinking and Programming-I Quiz 11

📋 Computational Thinking & Programming-I Quiz 11 — Lists in Python (Class 11 CS)

Practice 20 CBSE Class 11 Computer Science (Code 083) MCQs on Python lists — indexing, list operations (concatenation, repetition, membership, slicing), traversing a list, built-in functions/methods (len(), list(), append(), extend(), insert(), count(), index(), remove(), pop(), sort(), sorted()), nested lists, and suggested programs like finding the max/mean and linear search.

Every method and program result below has been verified by actually running it in Python. Tap any question to reveal the answer with a clear explanation.

📋 List Basics🔢 Indexing➕ List Operations🔁 Traversal🧰 Built-in Functions🪆 Nested Lists⭐ Suggested Programs
Q1
📋 List Basics

What is a list in Python?

  1. An immutable sequence of characters
  2. An ordered, mutable collection of items
  3. A fixed-size collection that cannot be changed
  4. A key-value mapping structure
Show Answer & Explanation

✅ Answer: (b) An ordered, mutable collection of items

A list is an ordered collection of items, written in square brackets like [1, 2, 3], and it’s mutable — items can be added, removed, or changed after creation.

Q2
🔢 Indexing

How do you access the first element of the list L = [10, 20, 30] using indexing?

  1. L[1]
  2. L(0)
  3. L[0]
  4. L.first()
Show Answer & Explanation

✅ Answer: (c) L[0]

Python indexing starts at 0, so L[0] gives the first element (10). L[1] would actually give the second element.

Q3
➕ List Operations

What is the result of the expression [1, 2] + [3, 4] in Python?

  1. [1, 2, 3, 4]
  2. [4, 6]
  3. Error
  4. [1, 2, [3, 4]]
Show Answer & Explanation

✅ Answer: (a) [1, 2, 3, 4]

+ concatenates two lists into one, joining their elements end to end: [1, 2, 3, 4].

Q4
➕ List Operations

What is the result of the expression [1, 2] * 2 in Python?

  1. [2, 4]
  2. [1, 2, 1, 2]
  3. Error
  4. [1, 2]
Show Answer & Explanation

✅ Answer: (b) [1, 2, 1, 2]

* repeats the list’s elements the given number of times: [1, 2, 1, 2].

Q5
➕ List Operations

What is the result of the expression 3 in [1, 2, 3] in Python?

  1. True
  2. False
  3. 3
  4. Error
Show Answer & Explanation

✅ Answer: (a) True

The in operator checks membership — since 3 is present in the list, this evaluates to True.

Q6
➕ List Operations

What does the slice L[1:3] return for the list L = [10, 20, 30, 40, 50]?

  1. [10, 20]
  2. [20, 30]
  3. [20, 30, 40]
  4. [30, 40]
Show Answer & Explanation

✅ Answer: (b) [20, 30]

Slicing [1:3] takes elements from index 1 up to (but not including) index 3 — that’s indices 1 and 2: [20, 30].

Q7
🔁 Traversal

Which of the following correctly traverses a list, visiting each element one at a time?

  1. for item in my_list:
  2. for item in range(my_list):
  3. while my_list:
  4. for item = my_list:
Show Answer & Explanation

✅ Answer: (a) for item in my_list:

for item in my_list: is the standard, direct way to traverse a list, giving you each element in order without needing to manage an index manually.

Q8
🧰 Built-in Functions

Which built-in function returns the number of elements in a list?

  1. count()
  2. len()
  3. size()
  4. index()
Show Answer & Explanation

✅ Answer: (b) len()

len() returns how many elements a list contains, e.g. len([1, 2, 3]) gives 3.

Q9
🧰 Built-in Functions

What does the expression list(“abc”) return in Python?

  1. “abc”
  2. [‘a’, ‘b’, ‘c’]
  3. [‘abc’]
  4. Error
Show Answer & Explanation

✅ Answer: (b) [‘a’, ‘b’, ‘c’]

The list() constructor converts an iterable (like a string) into a list of its individual elements: [‘a’, ‘b’, ‘c’].

Q10
🧰 Built-in Functions

What does L.append(4) do if L = [1, 2, 3]?

  1. Adds 4 to the end: [1, 2, 3, 4]
  2. Inserts 4 at the start: [4, 1, 2, 3]
  3. Adds 4 as a nested list: [1, 2, 3, [4]]
  4. Raises an error
Show Answer & Explanation

✅ Answer: (a) Adds 4 to the end: [1, 2, 3, 4]

append() adds a single item to the very end of the list: [1, 2, 3, 4].

Q11
🧰 Built-in Functions

What does L.extend([4, 5]) do if L = [1, 2, 3]?

  1. [1, 2, 3, [4, 5]]
  2. [1, 2, 3, 4, 5]
  3. Error
  4. [1, 2, 3]
Show Answer & Explanation

✅ Answer: (b) [1, 2, 3, 4, 5]

extend() unpacks its argument and adds each element individually to the end of the list: [1, 2, 3, 4, 5].

Q12
🧰 Built-in Functions

What does L.insert(2, 3) do if L = [1, 2, 4]?

  1. [1, 2, 3, 4]
  2. [1, 2, 4, 3]
  3. [3, 1, 2, 4]
  4. Error
Show Answer & Explanation

✅ Answer: (a) [1, 2, 3, 4]

insert(index, value) places the value at the given position, shifting later elements right: [1, 2, 3, 4].

Q13
🧰 Built-in Functions

What does L.count(2) return if L = [1, 2, 2, 3]?

  1. 1
  2. 2
  3. 3
  4. 0
Show Answer & Explanation

✅ Answer: (b) 2

count() tallies how many times the value appears in the list — 2 occurs 2 times.

Q14
🧰 Built-in Functions

What does L.index(6) return if L = [5, 6, 7]?

  1. 0
  2. 1
  3. 2
  4. Error
Show Answer & Explanation

✅ Answer: (b) 1

index() returns the position of the first matching value — 6 is at index 1.

Q15
🧰 Built-in Functions

What does L.remove(2) do if L = [1, 2, 3, 2]?

  1. Removes all 2s: [1, 3]
  2. Removes only the FIRST 2: [1, 3, 2]
  3. Removes only the LAST 2: [1, 2, 3]
  4. Raises an error
Show Answer & Explanation

✅ Answer: (b) Removes only the FIRST 2: [1, 3, 2]

remove() deletes only the first matching occurrence, scanning left to right: [1, 3, 2].

Q16
🧰 Built-in Functions

What does x = L.pop() do if L = [1, 2, 3]? What are x and L afterward?

  1. x = 1, L = [2, 3]
  2. x = 3, L = [1, 2]
  3. x = 3, L = [1, 2, 3]
  4. Raises an error
Show Answer & Explanation

✅ Answer: (b) x = 3, L = [1, 2]

With no index given, pop() removes and returns the last element: x = 3, and L becomes [1, 2].

Q17
🧰 Built-in Functions

What is the difference between L.sort() and sorted(L)?

  1. They do exactly the same thing
  2. sort() modifies the list in place and returns None; sorted() returns a new sorted list, leaving the original unchanged
  3. sort() returns a new list; sorted() modifies in place
  4. Neither actually sorts the list
Show Answer & Explanation

✅ Answer: (b) sort() modifies the list in place and returns None; sorted() returns a new sorted list, leaving the original unchanged

L.sort() rearranges the list itself and returns None. sorted(L) leaves the original list untouched and gives you a brand-new sorted list instead.

Q18
🪆 Nested Lists

For the nested list v = [[1, 2], [3, 4]], what does v[1][0] give?

  1. 1
  2. 2
  3. 3
  4. 4
Show Answer & Explanation

✅ Answer: (c) 3

Nested indexing works left to right: v[1] gives [3, 4], and [0] of that gives 3.

Q19
⭐ Suggested Programs

What does the following program print? (Finding max and mean of a list)

nums = [12, 45, 7, 23, 56, 9]
print(max(nums), sum(nums) / len(nums))
  1. 56 25.33
  2. 45 25.33
  3. 56 22.5
  4. 12 25.33
Show Answer & Explanation

✅ Answer: (a) 56 25.33

The maximum value is 56. The mean is the sum (152) divided by the count (6), giving approximately 25.33.

Q20
⭐ Suggested Programs

What does the following linear search & frequency-counting program print?

data = [4, 2, 7, 2, 9, 2, 5]
target = 2
positions = []
for i in range(len(data)):
    if data[i] == target:
        positions.append(i)
print(positions, len(positions))
  1. [1, 3, 5] 3
  2. [0, 2, 4] 3
  3. [1, 3, 5] 2
  4. [] 0
Show Answer & Explanation

✅ Answer: (a) [1, 3, 5] 3

A linear search checks every position one by one. The value 2 appears at indices 1, 3, and 5, so positions is [1, 3, 5] and its length (the frequency of 2 in the list) is 3.

Jitendra Singh
✔ Verified Educator

Jitendra Singh

Founder of CBSEPython.in

I help CBSE Class 9–12 students learn Python, Information Technology, Artificial Intelligence and Computer Science through easy notes, quizzes, MCQs and sample papers.

Read More About Me →