Which of the following methods removes the last element from a list in Python?
-
A
pop()
Correct answer
-
B
remove()
-
C
del()
-
D
clear()
13 views
Explanation
The pop() method removes and returns the last element from a list.
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ