A stack follows LIFO: the last item put in comes out first. The three core operations, push, pop and peek, touch only the top and take O(1). It is an example of an ADT: it can be implemented on different structures.

Push and pop on a stack
Push and pop on a stack

A stack on a list

The simplest stack in Python is a list: append pushes, pop() pops. The top is the end of the list, because insert(0, x) / pop(0) at the front shift every item (O(n)). When the capacity of a list runs out it is resized, so push is O(1) only amortized (amortized analysis). On an empty stack pop and peek should raise IndexError: a silent None hides the bug.

python
class Stack:
    def __init__(self):
        self._items = []

    def push(self, item):
        self._items.append(item)

    def pop(self):
        if not self._items:
            raise IndexError("pop from empty stack")
        return self._items.pop()