1.

Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop()?(a) [3, 4, 5, 20, 5, 25, 1](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]I got this question in an interview.I want to ask this question from Lists topic in division Lists & List Comprehension of Python

Answer»

Right choice is (a) [3, 4, 5, 20, 5, 25, 1]

Explanation: pop() by DEFAULT will remove the LAST ELEMENT.



Discussion

No Comment Found

Related InterviewSolutions