Python-Quizzes | Python List Quiz | Question 24
Question 24: Find the output of the following program:
L = [ 1 , 3 , 5 , 7 , 9 ] print (L.pop( - 3 ), end = ' ' ) |
(A) 5
(B) 9
(C) 7
(D) 3
Answer: (A)
Explanation: pop() will delete and return the element whose index was passed as parameter. L.pop(-3) will delete 5 and return 5, which is printed by print().
Quiz of this Question