What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use items.pop(0) when you want to remove and keep the first value. Use del items[0] to remove it without returning it, or items = items[1:] when you want a new list without the first item. For repeated first-in, first-out (FIFO) removal, use collections.deque and popleft().
Choose the method that matches what you need
| What you need | Use | What happens |
|---|---|---|
| Remove the first item and use its value | first = items.pop(0) |
Mutates items and returns the removed value. |
| Remove the first item without using its value | del items[0] |
Mutates the existing list; it does not return the removed value. |
| Create a list without the first item | items = items[1:] |
Creates a new list and rebinds items; other references to the old list remain unchanged. |
| Repeatedly remove items from the front as a queue | collections.deque with popleft() |
Uses a collection designed for efficient operations at both ends. |
Remove and return the first item with pop(0)
Pass index 0 to pop to remove the item at the start of the list and return its value:
As an Amazon Associate I earn from qualifying purchases.
items = [10, 20, 30]
first = items.pop(0)
print(first) # 10
print(items) # [20, 30]
This changes the original list. Choose it when the removed value is useful—for example, when processing the next item and keeping the rest for later.
Remove the first item in place with del
Use del items[0] if you want to mutate the list but do not need the removed value:
#1 Best Overall
items = [10, 20, 30]
del items[0]
print(items) # [20, 30]
del changes the existing list and does not produce the deleted item as a return value.
Create a new list with slicing
The slice items[1:] contains the elements from index 1 through the end. Assigning it back to the same name makes that name refer to a new list:
Rank #2
items = [10, 20, 30]
items = items[1:]
print(items) # [20, 30]
This does not remove anything from the original list object. If another variable refers to that object, it still sees the original contents:
Recommended Free Tools
items = [10, 20, 30]
alias = items
items = items[1:]
print(items) # [20, 30]
print(alias) # [10, 20, 30]
Use slicing when a separate list is what you want, rather than an in-place change.
Handle an empty list deliberately
Both items.pop(0) and del items[0] raise IndexError if the list is empty. A slice is safe on an empty list: items[1:] returns an empty list.
If the list may be empty, check before removing an item or handle the exception according to your program’s needs:
if items:
first = items.pop(0)
else:
first = None
Why repeated front removal is slow on a list
Removing an item at the front of a list requires shifting the remaining elements. The Python tutorial explains that popping from the beginning is slow “because all of the other elements have to be shifted by one.” The Python tutorial’s list-as-queue section recommends a deque for queue operations.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →The CPython time-complexity reference classifies pop(k) and deleting an item at index k as O(n-k), and deleting a slice starting at index i as O(n-i). These are asymptotic costs, not measured timings; the reference is specifically for CPython and notes that other Python implementations may differ. Slicing also constructs a result list, so it is not a constant-time way to consume queue items.
Best Value
Use deque.popleft() for a FIFO queue
If your program repeatedly consumes items from the front, use collections.deque:
from collections import deque
queue = deque([10, 20, 30])
first = queue.popleft()
print(first) # 10
print(queue) # deque([20, 30])
The Python deque documentation describes appends and pops at either end as approximately O(1), and contrasts them with the memory movement required by list.pop(0). A list remains useful when you need fast random access; indexed access on a deque slows toward the middle.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




