🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.L.remove(2)
  2. B.L.pop(2)
  3. C.del L[2]
  4. 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 →