Python built in functions ___________ and _____________ of list can be used to implement PUSH and POP respectively in a stack.
Python built in functions ___________ and _____________ of list can be used to implement PUSH and POP respectively in a stack.
Solution
✅ Correct Option: 4
A stack works on the LIFO (last in, first out) principle, so both operations happen at the end of the list. adds an element at the end, which is PUSH. removes and returns the last element, which is POP.
For example, st = [], then st.append(10) pushes 10, and st.pop() removes it.
Option 3: Python lists have no built-in method; does that job.
Options 1 and 2: is not a list method (del is a statement, not a function of list), and needs an index, so it is not the standard PUSH.
Related questions:
2026: 11 May Shift 2
2025: 16 May Shift 1
2026: 24 May Shift 1