Which list method removes the first item equal to a given value?
Correct answer A. remove()
Explanation
list.remove(x) deletes the first item whose value equals x and raises ValueError if there is none. pop() removes an item by index, defaulting to the last item, and returns it. discard() belongs to sets, and lists have no delete() method, although the del statement can remove items by index.
Answer checked How we write and check questions
Discussion