As per mentioned in the Python wiki. Time complexities are as follows:

  • Pop last O(1)
  • Delete Item O(n)
  • Set Slice O(k+n)

Experimental Study

import time

all_t = 0.
for i in range(1000):
    list_ = [i for i in range(100000)]
    start_ = time.time()
    list_.pop()
    all_t += time.time() - start_
print("Average Time for POP is {}".format(all_t/1000.))

all_t = 0.
for i in range(1000):
    list_ = [i for i in range(100000)]
    start_ = time.time()
    del list_[-1]
    all_t += time.time() - start_
print("Average Time for DEL is {}".format(all_t/1000.))

all_t = 0.
for i in range(1000):
    list_ = [i for i in range(100000)]
    start_ = time.time()
    list_ = list_[:-1]
    all_t += time.time() - start_
print("Average Time for SLICE is {}".format(all_t/1000.))

Results

Average Time for POP is 7.793903350830078e-07
Average Time for DEL is 9.80854034423828e-07
Average Time for SLICE is 0.0006206443309783935

Summary

pop() is the fastest when you do not specify an index.

Answer from Yahya on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-remove-rear-element-from-list
Python - Remove rear element from list - GeeksforGeeks
April 6, 2023 - Time complexity: O(1) - The pop() method takes constant time to remove the last element from the list. Auxiliary space: O(1) - No extra space is used in this code. Method #2: Using del list[-1] This is just the alternate method to perform the ...
🌐
Medium
thinklikeacto.medium.com › time-complexity-of-popping-elements-from-list-in-python-215ad3d9c048
Time complexity of popping elements from list in Python! | by Naresh Thakur | Medium
January 23, 2020 - Does it care about the time complexity? Consider we have following list. ... By doing a.pop() with no arguments it will remove and return the last element which has O(1) time complexity.
🌐
Reddit
reddit.com › r/learnpython › why does remove() work slower for last elements of a list than for the first element?
r/learnpython on Reddit: Why does remove() work slower for last elements of a list than for the first element?
March 11, 2024 -

So I was performing an experiment on the execution speed of the remove function on different list lengths and on three different positions of the list.

plot of running times

Green, blue and red plots denote the running times of the operation for the last element, middle element and the first element respectively.

Since remove works by shifting the subsequent elements to the left, I'd assume it'd take more time for remove to execute on the first element, k = 0, as the element shifting would be expensive. Then why is removing the last element more time consuming, by a large margin?

Top answer
1 of 4
18
The remove method must search the list for the index of the element to remove. It does this probably by iterating from the beginning. This part is much more expensive than the actual removal. If you want to benchmark the actual removal use the pop method instead, which takes an index to remove and not the element to remove.
2 of 4
4
So, the reason for this is how remove() works. If you run your test with del instead and go by index, you'll get the opposite result, with last element being removed faster than first element. Why? The remove() function is actually quite simple, and you could recreate it with the following code (not actual code since the underlying implementation is in C, but works the same core way): lst = range(100) size = len(lst) target = 5 for i in range(size): if lst[i] == target: del[i] return raise ValueError In other words, remove() works by going through each element one by one from beginning to end and then deleting the value at the first index that has a match, and raises a ValueError if nothing is found. Given that information, the reason why the last elements are slower than earlier elements should be quite obvious...the sooner the match is found in the loop, the faster it deletes it and breaks out of the loop. Elements at the very end of the list mean you have to look through all the initial elements first, and it's all of those equivalency checks that actually takes the time. If you change your program to use del and go by index, you'll find that deleting lst[-1] is faster than deleting lst[0]. In both cases the middle deletion and removal are in the middle, again for hopefully obvious reasons. Hopefully that makes sense!
🌐
Reddit
reddit.com › r/learnpython › why is removing elements from a list so slow, and is there a faster way?
r/learnpython on Reddit: Why is removing elements from a list so slow, and is there a faster way?
April 21, 2024 -

I was trying to write a simple application, which is ao supposed to filter a list of words down to a list of words of a certain length. For that I could either remove the words of the wrong length, or create a new list of words with the correct length.

I had a list of around 58000 words, and wanted to filter out all the 6 letter words, which are around 6900.

with open('words.txt') as f:
    words = f.readlines()
    for i in range(len(words)):
        words[i] = words[i].strip()

length = int(input("Desired word length "))

for i in reversed(words):
    if len(i) != length:
        words.remove(i)

This took 22 seconds.

Another way is to just create a new list with words of the correct length. I did this as follows:

with open('words.txt') as f:
    words = f.readlines()
    for i in range(len(words)):
        words[i] = words[i].strip()

length = int(input("Desired word length "))
clw = []

for i in words:
    if len(i) == length:
        clw.append(i)

This only took 0.03 seconds. How can it be that creating a list of 6900 words takes 0.03 seconds, but removing 51100 words takes 22? It's only 7 times as many words, but takes 700 times as long. And is there a better and faster way to quickly remove list elements?

🌐
LabEx
labex.io › tutorials › python-what-is-the-time-complexity-of-list-append-and-remove-operations-in-python-397728
What is the time complexity of list append and remove operations in Python | LabEx
The linear time complexity of the list.remove() operation means that it may not be the most efficient way to remove elements from a list, especially when dealing with large datasets. In such cases, it may be more efficient to use a different data structure, such as a set or a deque, which can provide more efficient removal operations. By the end of this tutorial, you will have a deep understanding of the time complexity of list append and remove operations in Python.
🌐
PyTutorial
pytutorial.com › python-list-remove-last-element
PyTutorial | Python List Remove Last Element
May 23, 2026 - All three methods have O(1) time complexity for removing the last element. Python lists are dynamic arrays.
🌐
Finxter
blog.finxter.com › home › learn python blog › what is the difference between remove(), pop() and del in lists in python?
What is The Difference Between remove(), pop() and del in Lists in Python? - Be on the Right Side of Change
December 17, 2021 - ... Note that the deleted value is returned when you call the pop() method. Example 2: Let us say, we pass a value to the pop() method, the element located in that index will be deleted.
🌐
LinkedIn
linkedin.com › all › engineering › computer science
How can you remove an element from a Python list?
March 4, 2024 - The pop() method is not only useful for removing elements but also for implementing stacks in Python, where it represents the 'pop' operation in a Last In, First Out (LIFO) data structure. It's important to note that pop() modifies the list in place and can cause IndexError if you pop from an empty list or with an invalid index. Additionally, when considering performance, pop() is efficient as it runs in constant time, O(1), for the last element but can be O(n) for specific indices due to the need to shift the remaining elements.
Find elsewhere
🌐
PyTutorial
pytutorial.com › python-list-remove-time-complexity
PyTutorial | Python List Remove Time Complexity
May 23, 2026 - If you need to remove many elements, always prefer a linear-time solution over a quadratic one. The list.remove() method has a time complexity of O(n) due to searching and shifting. This is acceptable for small lists but can be slow for large ones.
🌐
Reddit
reddit.com › r/learnprogramming › why is it that removing an element from the start of an array o(n) while at the end o(1)?
r/learnprogramming on Reddit: Why is it that removing an element from the start of an array O(n) while at the end O(1)?
September 16, 2023 -

From my understanding the reason why removing the last element is O(1) is because you don't need to shift the array in memory. You simply remove the last element and leave the old space empty. So why is it that if you remove the first element that the Array HAS to to shift in memory (making it O(n))?

I don't understand the reasoning, if we are okay with leaving empty space in memory at the end of an array and not shifting all the other things surrounding the array in memory. Then why do we have to shift the array in memory if there is space that the start?

I am not understanding, if it's because the memory is trying to stay compact and no empty spaces are allowed. Then why don't all the other stuff in memory be shifted to the left after new space was cleared once we removed the last element from the array?

🌐
DataCamp
datacamp.com › tutorial › python-pop
How to Use the Python pop() Method | DataCamp
July 31, 2024 - When you use the pop() method without an argument or with -1 as the index to remove the last element, it operates in O(1) time because it only removes the last element in the list without changing the other elements. When we use the pop() method to remove the first or any other element, it ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-front-and-rear-range-deletion-in-a-list
Python | Front and rear range deletion in a list - GeeksforGeeks
July 11, 2025 - Time complexity: O(n), where n is the length of the list, because we need to traverse the list twice, once for removing the first two elements and once for removing the last two elements Auxiliary space: O(1), because we are modifying the original ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-remove-given-element-from-the-list
Python | Remove given element from the list - GeeksforGeeks
July 11, 2025 - Time Complexity: O(n) where n is the elements in the list Auxiliary Space: O(n), where n is the length of the list · Since the list is converted to set, all duplicates are removed, but the ordering of the list cannot be preserved.
🌐
LabEx
labex.io › tutorials › python-how-to-efficiently-remove-elements-from-the-left-side-of-a-python-list-397985
How to efficiently remove elements from the left side of a Python list | LabEx
The del statement and slicing with a step size of 1 have a time complexity of O(k), where k is the number of elements removed. For large lists or frequent left-side removals, using the del statement or slicing with a step size of 1 can be more ...
🌐
FavTutor
favtutor.com › blogs › remove-last-element-from-list-python
Remove Last Element from List in Python | FavTutor
October 12, 2023 - To delete the last element, we can use the negative index -1. The use of the negative index allows us to delete the last element, even without calculating the length of the list. This decreases the complexity of the program significantly.