Skip to main contentSkip to solution

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.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question