CBSE Class 12 Computer Science
Question 30 of 105
Python Revision Tour II — Question 9
Back to all questionsdel AL[2]
AL[2:3] = []
AL.remove(3)
Reason — del AL[2] — The del keyword deletes the element from the list AL from index 2.AL[2:3] = [] — The slicing of the list AL[2:3] begins at index 2 and ends at index 2. Therefore, the element at index 2 will be replaced by an empty list [].AL.remove(3) — The remove() function removes an element from the list AL from index 3."