1.

To insert 5 to the third position in list1, we use which command?(a) list1.insert(3, 5)(b) list1.insert(2, 5)(c) list1.add(3, 5)(d) list1.append(3, 5)I have been asked this question in an interview for job.The query is from Lists topic in chapter Lists & List Comprehension of Python

Answer»

Correct option is (b) list1.insert(2, 5)

To explain: EXECUTE in the shell to VERIFY.



Discussion

No Comment Found

Related InterviewSolutions