The pop() method removes and returns the element at a given index. Without an argument, it removes the last element: fruits = ["apple", "banana", "cherry"] then last = fruits.pop() sets last to "cherry" and leaves ["apple", "banana"].
With an index, it removes that position: first = fruits.pop(0) sets first to "apple" and leaves ["banana"].
Unlike remove(), pop() returns the removed element, which is useful when you need to use that value. An IndexError is raised if the index is out of range. Use pop() for stack operations (last in, first out) or when you need the removed value.