Complete Playlist : https://bit.ly/3GLnZPy
Solution:
Answer: D. Explanation:
The list.pop method removes an element from the list, and returns the removed element.
When used without arguments, pop removes and returns the last element of the list.
When an argument index is specified,
li.pop(index) removes the element li[index] from li, and returns the removed element.
When li.pop(1) is executed, li[1] is removed from li, and the removed value is returned.
Here li[1] is 3. Therefore, li is modified to [2,1], and the return value from li.pop(1) is 3
0 Comments:
Post a Comment