A

Admin • 833.24K Points
Coach

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)
  • Correct Answer - Option(B)
  • Views: 27
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

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.

Be the first to start discuss.