1.

Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?(a) Error(b) None(c) 25(d) 2This question was addressed to me in a national level competition.This interesting question is from Lists topic in portion Lists & List Comprehension of Python

Answer»

Correct answer is (c) 25

To explain I would SAY: -1 corresponds to the LAST index in the list.



Discussion

No Comment Found

Related InterviewSolutions