1.

Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?(a) [2, 33, 222, 14](b) Error(c) 25(d) [25, 14, 222, 33, 2]I got this question at a job interview.The doubt is from Lists topic in division Lists & List Comprehension of Python

Answer» RIGHT option is (a) [2, 33, 222, 14]

The explanation is: EXECUTE in the SHELL to verify.


Discussion

No Comment Found

Related InterviewSolutions