The effects of the three different methods to remove an element from a list:

remove removes the first matching value, not a specific index:

>>> a = [0, 2, 3, 2]
>>> a.remove(2)
>>> a
[0, 3, 2]

del removes the item at a specific index:

>>> a = [9, 8, 7, 6]
>>> del a[1]
>>> a
[9, 7, 6]

and pop removes the item at a specific index and returns it.

>>> a = [4, 3, 5]
>>> a.pop(1)
3
>>> a
[4, 5]

Their error modes are different too:

>>> a = [4, 5, 6]
>>> a.remove(7)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list
>>> del a[7]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: list assignment index out of range
>>> a.pop(7)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: pop index out of range
Answer from Martijn Pieters on Stack Overflow
Discussions

Pop vs Del
Ceil-Ian Maralit is having issues with: Hello! This got me confused a bit. Does pop() and del have the same purpose? Because Craig s... More on teamtreehouse.com
🌐 teamtreehouse.com
3
October 31, 2018
python - Which is faster? `list.pop(0)` vs `del list[0]`? - Stack Overflow
Which list operation is faster? list.pop(0) or del list[0]? More on stackoverflow.com
🌐 stackoverflow.com
Difference between pop and remove
Also, pop returns that value that was removed, remove doesn’t. More on reddit.com
🌐 r/learnpython
10
3
June 29, 2022
I was surprised at how slow list.pop() is! And list.remove() is even many times slower
This is simply how lists work, nothing surprising here. Removing the first element requires moving all the elements after it one step to the left to fill that gap, which makes this operation run in linear time. It means that clearing the list this way is O(n2), so it unsurprisingly takes a long time, as bubble sorting the (shuffled) list could even be faster. This is why we think of alternatives when solving problems, such as using collections.deque, reversing the list (O(n) instead of O(n2)) or just using pop() from the end if it works. More on reddit.com
🌐 r/learnpython
38
57
August 22, 2021
🌐
DEV Community
dev.to › felipecezar01 › pop-vs-del-in-python-same-result-completely-different-intent-21eb
pop() vs del in Python: Same Result, Completely Different Intent - DEV Community
February 26, 2026 - 🔎 Note: If I didn’t assign it to current_task, "Sleep" would still be removed. But the whole point of pop() is usually to use the removed value. You want to delete something specific by index and don’t care about the value.
Top answer
1 of 3
19
Good question! A simple difference is pop() returns the item removed so it can be assigned a different label while del simply removes the item. If you use pop() and do not assign a new label to the returned object it is essentially performing the same function as del. The list of book title strings is actually a list of references that point to string objects stored in memory. Each string object "id" is the address in memory of the stored object. ```python b1 = "book title 1" b2 = "book title 2" b3 = "book title 3" b4 = "book title 4" book_list = [b1, b2, b3, b4] print(book_list) ['book title 1', 'book title 2', 'book title 3', 'book title 4'] print([id(b1), id(b2), id(b3, id(b4)]) [139996358750368, 139996358750256, 139996358750592, 139996358750648] print([id(book) for book in book_list]) [139996358750368, 139996358750256, 139996358750592, 139996358750648] saved = book_list.pop(0) print(saved) book title 1 print(id(saved)) 139996358750368 ``` In a more detailed look, pop() returns the "id" reference removed so that it can be assigned to another label or used in a subsequent statement. The label saved is assigned to the first book popped from the book list. So, use pop() when you want to have access to the removed item for another purpose, and use del when you no longer want the item. Edit: to comment on “garbage collection”. Garbage collection happens when an object is removed from memory and the memory freed for other uses. This occurs when all references to an object are removed. pop() removed the list’s reference to object (count goes down by 1). If count is now zero, object maybe garbage collected. If a label is assigned to the popped object, this adds a new reference (count goes up by 1). So labeling a pop becomes a wash (no net change in reference count). del removes the label (the count goes down by 1) but not the object. Using del b4 simply removes the label b4 but not the object referenced by b4 since the string “book title 4” is still referenced by the list. Post back if you have more questions. Good luck!!
2 of 3
1
Really good questions and answers. Thank you so much!
🌐
GeeksforGeeks
geeksforgeeks.org › what-is-difference-between-del-remove-and-pop-on-python-lists
Difference Between Del, Remove and Pop in Python Lists - GeeksforGeeks
December 13, 2024 - remove() method deletes values or objects from the list using value and del and pop() deletes values or objects from the list using an index. del is a Python Keyword that is used to delete items from a list by index or to remove the entire list.
Find elsewhere
🌐
CSEstack
csestack.org › home › difference between remove del and pop in python list
Difference Between remove del and pop in Python List
July 12, 2021 - You’re welcome, Ruskar. You can also check other Python tutorial. This might help you with your preparation. ... Also, del can be used to delete the entire list whereas pop can only be used to delete element at a specific index.
🌐
STechies
stechies.com › difference-between-del-remove-pop-lists
Difference between del, remove and pop Methods in Python
What is the difference between del, remove and pop in Python programming language. Python Remove is a method which takes an element as an argument and removes it from a defined list. The del() method can delete an item with the help of index but does not return any value.
🌐
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 - [toc] remove(), pop() and del can all be used to delete items from the list in Python. However, there are some underlying differences between these three functions with respect to the way they operate, error modes, and computational complexities. Let us try to understand the differences between ...
🌐
Reddit
reddit.com › r/learnpython › i was surprised at how slow list.pop() is! and list.remove() is even many times slower
r/learnpython on Reddit: I was surprised at how slow list.pop() is! And list.remove() is even many times slower
August 22, 2021 -

I know there is a list.clear(), I'm just sharing that I didn't expect that using list.pop() and list.remove() specifically could slow down the program that much.

li = list(range(500000))

Creating a list is quick.

So we are going to test out pop/remove specific values. For the purpose of this "benchmark", we are going to remove all elements from the list:

while (li):
    li.pop(0)

It took 74.735 seconds to pop all the elements! It's ridiculously long.
I KNOW it would have been much faster if I even had used li.pop() without the index or maybe used filter function, list comprehension with conditional or whatever
But that's what I'm trying to show, how slow it is to remove certain list items specifically using pop and remove methods.

And li.remove(), which always requires a specified value to remove, is even worse than pop!

 for num in li:
    li.remove(num)

This one took me 303.268 seconds to complete. How crazy it is.

I've been having fun with abstract data structures. Implemented linked lists and a queues running on linked lists.

And for the sake of interest, I decided to compare the performance of the queue based on the linked list and the usual python list. And I was surprised. When my linked list Queue dequeued 500.000 elements in 0.5 seconds, while python list Queue was doing it in 75 seconds.

Top answer
1 of 5
46
This is simply how lists work, nothing surprising here. Removing the first element requires moving all the elements after it one step to the left to fill that gap, which makes this operation run in linear time. It means that clearing the list this way is O(n2), so it unsurprisingly takes a long time, as bubble sorting the (shuffled) list could even be faster. This is why we think of alternatives when solving problems, such as using collections.deque, reversing the list (O(n) instead of O(n2)) or just using pop() from the end if it works.
2 of 5
13
Just thought I'd mention that, on top of being the slowest option presented here, for num in li: li.remove(num) is also broken; it skips every other value in the list and the result is essentially only half of the original list, not an empty one. The reason for this already came up in the other answers, as the values shift in the list when you remove one, but the loop itself doesn't take this into account. You can think of the loop as if it had a hidden index variable it updates on every iteration, and when the values are shifted what was previously going to be the next value after deletion is now where the deleted one was, the loop index goes up by one, and the next index to be removed is the one next to the current one. EDIT: It's easier to understand visually, I guess. idx | 0 | 1 | 2 | 3 | 4 | val | 1 | 2 | 3 | 4 | 5 Loop index: 0 Removing item at index 0 idx | 0 | 1 | 2 | 3 | 4 | val | 2 | 3 | 4 | 5 | ... Loop index: 1 Removing item at index 1 idx | 0 | 1 | 2 | 3 | 4 | val | 2 | 4 | 5 | ... | ... Loop index: 2 Removing item at index 2 Idx | 0 | 1 | 2 | 3 | 4 | val | 2 | 4 | ... | ... | ... EDIT #2: If you needed to empty a list in a real project, the best options would be to either reassign an empty list, or use list.clear which is way faster than using list.pop in a loop.
🌐
Javatpoint
javatpoint.com › difference-between-del-and-pop-in-python
Difference between 'del' and 'pop' in python - Javatpoint
Difference between 'del' and 'pop' in python with tutorial, tkinter, button, overview, canvas, frame, environment set-up, first python program, etc.
🌐
Reddit
reddit.com › r/learnpython › del or remove to delete an item from a list
r/learnpython on Reddit: del or remove to delete an item from a list
May 24, 2018 -

Hi, I'm currently learning Python using, among others, automatetheboringstuff.com
It's a great resource, and I enjoy hacking through the projects.

I am now finishing Chapter 8 (https://automatetheboringstuff.com/chapter8/), and I'm doing the first project, "Create the Quiz File and Shuffle the Question Order".

In that project, at one point, we need to remove an item from a list. Said item's value is stored in a variable. I decided to use the .remove command, like this:

my_list = ['cat', 'dog', 'duck', 'rabbit']
item_to_be_removed = 'dog'        

my_list.remove(item_to_be_removed)

But the author uses instead the "del" command, such as:

del my_list[my_list.index(item_to_be_removed)]    

My question: is there a difference ? It seems much easier to use the first method. I understand that "del" will delete an item using it's index number, and "remove" will remove the first instance of the value we want to delete. But in the context of the project, I don't see why del was chosen.

(Both "del" and ".remove" were explained in previous chapters of the book)

🌐
Codemia
codemia.io › knowledge-hub › path › difference_between_del_remove_and_pop_on_lists_in_python
Difference between del, remove, and pop on lists in Python
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
🌐
Codecademy Forums
discuss.codecademy.com › t › why-use-del-instead-of-pop › 322277
Why use del() instead of pop()? - Lists and Functions - Codecademy Forums
June 5, 2018 - The extra work pop does is not significant, no. Deleting is a fairly uncommon operation, typically you simply stop referring to something ... No, references aren’t directly accessible. We get names and lists/dicts and anything else that’s supplied from some C module since those have direct memory access. Storage is magical in the sense that it can’t be defined by pure python slices falls under key, since that’s done by sending a slice object as the key
🌐
Stack Abuse
stackabuse.com › bytes › difference-between-del-remove-and-pop-in-python-lists
Difference Between del, remove, and pop in Python Lists
September 2, 2023 - In this Byte, we've explored the ... pop in Python. We've seen that del and remove are used for removing items from a list, while pop can also return the removed item. As always, the choice between these methods depends on your specific needs in your code. ... Reliable monitoring for your app, ...
🌐
Quora
quora.com › In-Python-whats-the-difference-between-pop-del-and-remove-on-lists
In Python, what's the difference between pop, del and remove on lists? - Quora
Answer (1 of 8): The remove operation on a list is given a value to remove. It searches the list to find an item with that value and deletes the first matching item it finds. It is an error if there is no matching item. 5. Data Structures The del statement can be used to delete an entire list. I...
🌐
Medium
medium.com › @mrbean0228 › what-are-the-differences-between-remove-pop-and-del-in-python-f20dca97006b
What Are the Differences Between remove(), pop(), and del in Python? | by Sebastian Blue | Medium | Medium
May 24, 2022 - So they will show you None when you try the same as above · letters = ['a', 'b', 'c', 'd', 'e'] removed_item = letters.remove('b') print(removed_item)-> None · pop method removes the last item in a list if no index is specified
🌐
Codecademy
codecademy.com › forum_questions › 50856c70e033eb0200006b08
1.4 Use remove not pop. (Just feed back and better hint alternative) | Codecademy
Like zygnoth says in a comment below, n.pop() has not been taught before (and n.remove() certainly not either). @ Stuart Connall To add to what you have written, n.pop() not only deletes the item at the requested index but also prints it (in a locally installed Python shell and in Scratch Pad).
🌐
Medium
medium.com › @hadiqagohar12 › understanding-the-difference-between-remove-and-pop-in-python-4b7e1494aaf9
Understanding the Difference Between remove() and pop() in Python | by Hadiqa Gohar | Medium
March 6, 2025 - When working with lists in Python, we often need to remove elements. Python provides multiple ways to do this, but two commonly used methods are remove() and pop(). While both methods help in deleting elements, they work differently and are used in different scenarios.