मान लीजिए q= [3, 4, 5, 20, 5, 25, 1, 3], तो q.pop(1) के बाद q सूची के आइटम क्या होंगे?
Assume q= [3, 4, 5, 20, 5, 25, 1, 3], then what will be the items of q list after q.pop(1) ?
A)
B)
C)
D)
Explanation:
The pop()
method removes an item from the list at the specified index and returns the removed item.
In this case, q.pop(1)
removes the item at index 1
from the list q
.
Here's the list before and after using pop(1)
:
- Initial list:
q = [3, 4, 5, 20, 5, 25, 1, 3]
- After
q.pop(1)
, the item at index 1 (which is4
) is removed, so the list becomes:q = [3, 5, 20, 5, 25, 1, 3]
Thus, the list after q.pop(1)
is [3, 5, 20, 5, 25, 1, 3]
.
Answer: (C) [3, 5, 20, 5, 25, 1, 3].