HOWTO · Python
How to Remove the First Element From a List in Python
Remove the first item from a Python list by index, by value, or by creating a sliced copy.
On this page
To remove the first item from a Python list and change that list, call items.pop(0) or use del items[0]. Index 0 is the first position. Use items[1:] when you need a separate list that skips that position; use remove(value) only when you know the value to remove.
Use pop(0) to remove the first item in place
pop(0) removes the item at index 0 from the original list and returns that item. This is useful when later code needs the removed value as well as the updated list. Calling pop() without an index removes the last item instead.
Run this example:
items = ["red", "green", "blue"]
removed = items.pop(0)
print(removed)
print(items)
The original list is changed, so other variables referring to the same list see the removal too. Removing an item from the front of a Python list shifts the remaining items one position toward the start; for many repeated left removals, consider a deque instead.
Use del to remove the first item in place
Use del items[0] when you want to remove the first position but do not need the removed value. It changes the original list, like pop(0), but del is a statement and does not return an item.
items = ["red", "green", "blue"]
del items[0]
print(items)
Use remove() only when removing by value
items.remove(value) searches for the first item equal to value and removes that match. It does not mean “remove the item at index 0.” If the first value is already known, pass it directly. With duplicate values, only the earliest matching value is removed.
For example, if items is ["red", "green", "red"], then items.remove("red") leaves ["green", "red"]. If you do not know the first value but want the first position, use pop(0) or del items[0] instead. An empty list has no first value to pass to remove().
Use slicing when you need a new list without the first item
items[1:] creates a new list containing all items from index 1 through the end. It leaves the original list unchanged. Assign the result back to items if you want the variable to refer to the sliced list:
items = ["red", "green", "blue"]
remaining = items[1:]
print(remaining)
print(items)
The slice has no explicit ending index because Python uses the end of the list by default. The result is a shallow copy: the outer list is new, while any mutable objects inside it are still shared.
Use numpy.delete() when working with a NumPy array
For a one-dimensional NumPy array, numpy.delete(array, 0) returns a new array with the value at index 0 removed; it does not mutate the input array. With a multidimensional array, the default axis=None flattens the array before deleting, so specify an axis when you mean a row or column—for example, numpy.delete(array, 0, axis=0) returns a new array without the first row. This function requires NumPy and is an array operation, not a Python list method. Use it when the data is already an array, rather than converting an ordinary list for a single removal.
Use deque.popleft() for repeated removals from the left
When a queue needs repeated removals from its left side, collections.deque provides popleft(). It removes and returns the leftmost item. A deque is designed for efficient operations at both ends, while removing the first item from a list shifts the remaining items. For one removal from an ordinary list, pop(0) or del items[0] is simpler; convert to a deque when the surrounding workflow benefits from queue operations.