Carefully analyze the following Python program segment and determine the…
2026
Carefully analyze the following Python program segment and determine the correct output:
L = [4, 7, 2, 8, 2, 5]
L.insert(1, 0)
L.pop(2)
L.remove(2)
L.extend([3, 1])
print(L)
Answer: D. [4, 0, 8, 2, 5, 3, 1]
- A.
[0, 4, 8, 2, 5, 3, 1]
- B.
[4, 0, 8, 2, 5, [3, 1]]
- C.
[4, 0, 8, 2, 5, [3, 1]]
- D.
[4, 0, 8, 2, 5, 3, 1]
Attempted by 224 students.
Show answer & explanation
Correct answer: D
Loading lesson…