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)
πŸ’¬ Discuss
βœ… Correct Answer: (B) list.insert(index, obj)
Explanation: The insert() method inserts an element at a given index into a list. It returns nothing.
Explanation by: Rajeev Malhotra
The insert() method inserts an element at a given index into a list. It returns nothing.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
246
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Rajeev Malhotra
Publisher
πŸ“ˆ
97%
Success Rate