Python_Institute
PCEP-30-02 · Question #373
What is the expected output of the following code? nums = [3, 4, 5, 20, 5, 25, 1, 3] nums.pop(1) print(nums)
The correct answer is C. [3, 5, 20, 5, 25, 1, 3]. See the full explanation below for the reasoning.
Question
What is the expected output of the following code?
nums = [3, 4, 5, 20, 5, 25, 1, 3]
nums.pop(1)
print(nums)
Options
- A[3, 1, 25, 5, 20, 5, 4]
- B[3, 4, 5, 20, 5, 25]
- C[3, 5, 20, 5, 25, 1, 3]
- D[1, 3, 3, 4, 5, 20, 25]
- E[3, 4, 5, 20, 5, 25, 1, 3]
How the community answered
(37 responses)- A3% (1)
- B3% (1)
- C70% (26)
- D8% (3)
- E16% (6)
Community Discussion
No community discussion yet for this question.