Which method removes and returns the last element of a list?

Python Developer Easy

Python Developer — Easy

Which method removes and returns the last element of a list?

Key points

  • pop() removes and returns the last element of a list
  • remove() removes a specific element, not necessarily the last one
  • del() removes an element at a specified index
  • discard() removes a specific element if it exists in the list

Ready to go further?

Related questions