Python Lists MCQs – Multiple Choice Questions for Practice
Practice Python lists with multiple choice questions (MCQs). Test your knowledge on list creation, indexing, slicing, and common list methods with beginner-friendly questions and answers.
Topic: lists
📝 Multiple Choice Questions
🟢 Beginner
Q1. What is the correct way to create an empty list in Python?
🟢 A. []
🔵 B. list()
🟠 C. Both of the above
🔴 D. None of the above
Answer
Both of the above
Both [] and list() can be used to create an empty list in Python.
Q2. What will be the output of the following code?
my_list = ['a', 'b', 'c']
print(my_list[1])
🟢 A. 'a'
🔵 B. 'b'
🟠 C. 'c'
🔴 D. Error
Answer
'b'
List indices start at 0, so index 1 refers to the second element 'b'.
Q3. Which method adds an element to the end of a list?
🟢 A. append()
🔵 B. add()
🟠 C. insert()
🔴 D. extend()
Answer
append()
The append() method adds a single element to the end of the list.
🟡 Intermediate
Q1. What does the following code return?
nums = [0, 1, 2, 3, 4, 5]
print(nums[1:4])
🟢 A. [0, 1, 2, 3]
🔵 B. [1, 2, 3]
🟠 C. [1, 2, 3, 4]
🔴 D. [0, 1, 2]
Answer
[1, 2, 3]
Slicing is inclusive of the start index and exclusive of the end index.
Q2. What is the difference between list.pop() and list.remove()?
🟢 A. pop() removes by index, remove() removes by value
🔵 B. pop() removes by value, remove() removes by index
🟠 C. Both remove by index
🔴 D. Both remove by value
Answer
pop() removes by index, remove() removes by value
pop() removes and returns an item at the given index (last by default), while remove() deletes the first occurrence of the specified value.
🔴 Advanced
Q1. What is the output of the following code?
numbers = [1, 2, 3, 4]
print(numbers[::-1])
🟢 A. [1, 2, 3, 4]
🔵 B. [4, 3, 2, 1]
🟠 C. [4]
🔴 D. Error
Answer
[4, 3, 2, 1]
The [::-1] slice creates a reversed copy of the list.
Q2. What will be the value of `a` after executing this code?
a = [1, 2]
b = [3, 4]
a.extend(b)
print(a)
🟢 A. [1, 2, 3, 4]
🔵 B. [1, 2, [3, 4]]
🟠 C. [3, 4, 1, 2]
🔴 D. [1, 3, 2, 4]
Answer
[1, 2, 3, 4]
extend() adds all elements of an iterable to the end of the list, flattening them.