Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?
(a) [3, 4, 5, 20, 5, 25, 1, 3]
(b) [1, 3, 3, 4, 5, 5, 20, 25]
(c) [3, 5, 20, 5, 25, 1, 3]
(d) [1, 3, 4, 5, 20, 5, 25]
Answer:
The pop( ) function removes the element at the position specified in the parameter.
Here, the position mentioned is 1 and the element at position 1 is 4.
So, 4 is removed and list1 will become [3,5,20,5,25,1,3].
So, the correct answer is (c).