← Quiz: Python Lists: all 15 questions
Quiz: Python Lists · Question 5 of 15
Which removes and RETURNS the item at index 2 of list L?
Which removes and RETURNS the item at index 2 of list L?
- A.L.remove(2)
- B.L.pop(2)
- C.del L[2]
- D.L.delete(2)
Answer & explanation
Correct answer: L.pop(2)
pop(i) removes and returns the item at index i. remove(2) removes the VALUE 2; del does not return anything.
Can you get the rest right without peeking?
Take the timed Quiz: Python Lists quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →