Home / Programming MCQs / Python MCQs / Question

R

Rajeev Malhotra • 3.97K Points
Extraordinary

Q. Which function inserts an object at a given index into a list?

(A) list.index(obj)
(B) list.insert(index, obj)
(C) list.pop(obj=list[-1])
(D) list.remove(obj)
Explanation by: Rajeev Malhotra
The insert() method inserts an element at a given index into a list. It returns nothing.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.