The built-in methods in Python for insertion and removal of elements in list for implementation of the stack are _____ and ______.
The built-in methods in Python for insertion and removal of elements in list for implementation of the stack are _____ and ______.
Solution
✅ Correct Option: 4
A Python list works as a stack (Last In, First Out) using append(x), which adds an element at the end (push), and pop(), which removes and returns the last element (pop).
Option 1: Python lists have no push() method, even though "push" is the standard stack term.
Option 2: add() is a set method, not a list method, and del is not a method.
Option 3: del is a Python statement (keyword), not a built-in list method, and it does not return the removed element.
Related questions:
2025: 13 May Shift 2
2025: 16 May Shift 1
2026: 26 May Shift 1
2026: 20 May Shift 1