My answer is not exactly to your question but after you read this, I hope you can decide which type you need to choose for your needs.

Python’s lists are variable-length arrays, not Lisp-style linked lists. The implementation uses a contiguous array of references to other objects, and keeps a pointer to this array.

This makes indexing a list a[i] an operation whose cost is independent of the size of the list or the value of the index.

When items are appended or inserted, the array of references is resized. Some algorithm is applied to improve the performance of appending items repeatedly; when the array must be grown, some extra space is allocated so the next few times don’t require an actual resize i.e over-allocation. More Information

Removing vs Pop vs Delete:

At first glance it looks like all of them are doing the same thing.

Under the hood its behaving different.

removing : remove an element from the list by iterating from 0 index till the first match of the element is found. taking more time to iterate if the element is at the end.

pop : removing element from the list by using the index. taking less time.

del : is a python statement that removes a name from a namespace, or an item from a dictionary, or an item from a list by using the index.

REMOVE:

  • it removes the first occurence of value.
  • raises ValueError if the value is not present.
  • it takes only one argument, so you can't remove multiple value in one shot.

POP:

  • remove and return item at index (default last).
  • Raises IndexError if list is empty or index is out of range.
  • it takes only one argument, so you can't remove multiple value in one shot.

DEL:

  • remove the item at index and return nothing.
  • it can remove slices from a list or can clear the whole list.

Benchmark:

Worst case : deleting from the end of the list.

yopy:-> python -m timeit "x=range(1000)" "x.pop(999)"
100000 loops, best of 3: 10 usec per loop
yopy:-> python -m timeit "x=range(1000)" "x.remove(999)"
10000 loops, best of 3: 31.3 usec per loop
yopy:-> python -m timeit "x=range(1000)" "del x[999]"
100000 loops, best of 3: 9.86 usec per loop
yopy:->

Best case: begining of the list.

yopy:-> python -m timeit "x=range(1000)" "x.remove(1)"
100000 loops, best of 3: 10.3 usec per loop
yopy:-> python -m timeit "x=range(1000)" "x.pop(1)"
100000 loops, best of 3: 10.4 usec per loop
yopy:-> python -m timeit "x=range(1000)" "del x[1]"
100000 loops, best of 3: 10.4 usec per loop
yopy:->

Point to be noted:

if array grows or shrinks in the middle

  • Realloc still depends on total length.
  • But, All the trailing elements have to be copied

So, now I hope you can decide what you need to choose for your needs.

Answer from James Sapam on Stack Overflow
🌐
W3Schools
w3schools.com › PYTHON › python_lists_remove.asp
Python - Remove List Items
The del keyword can also delete the list completely. ... The clear() method empties the list. The list still remains, but it has no content. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us ...
Top answer
1 of 4
62

My answer is not exactly to your question but after you read this, I hope you can decide which type you need to choose for your needs.

Python’s lists are variable-length arrays, not Lisp-style linked lists. The implementation uses a contiguous array of references to other objects, and keeps a pointer to this array.

This makes indexing a list a[i] an operation whose cost is independent of the size of the list or the value of the index.

When items are appended or inserted, the array of references is resized. Some algorithm is applied to improve the performance of appending items repeatedly; when the array must be grown, some extra space is allocated so the next few times don’t require an actual resize i.e over-allocation. More Information

Removing vs Pop vs Delete:

At first glance it looks like all of them are doing the same thing.

Under the hood its behaving different.

removing : remove an element from the list by iterating from 0 index till the first match of the element is found. taking more time to iterate if the element is at the end.

pop : removing element from the list by using the index. taking less time.

del : is a python statement that removes a name from a namespace, or an item from a dictionary, or an item from a list by using the index.

REMOVE:

  • it removes the first occurence of value.
  • raises ValueError if the value is not present.
  • it takes only one argument, so you can't remove multiple value in one shot.

POP:

  • remove and return item at index (default last).
  • Raises IndexError if list is empty or index is out of range.
  • it takes only one argument, so you can't remove multiple value in one shot.

DEL:

  • remove the item at index and return nothing.
  • it can remove slices from a list or can clear the whole list.

Benchmark:

Worst case : deleting from the end of the list.

yopy:-> python -m timeit "x=range(1000)" "x.pop(999)"
100000 loops, best of 3: 10 usec per loop
yopy:-> python -m timeit "x=range(1000)" "x.remove(999)"
10000 loops, best of 3: 31.3 usec per loop
yopy:-> python -m timeit "x=range(1000)" "del x[999]"
100000 loops, best of 3: 9.86 usec per loop
yopy:->

Best case: begining of the list.

yopy:-> python -m timeit "x=range(1000)" "x.remove(1)"
100000 loops, best of 3: 10.3 usec per loop
yopy:-> python -m timeit "x=range(1000)" "x.pop(1)"
100000 loops, best of 3: 10.4 usec per loop
yopy:-> python -m timeit "x=range(1000)" "del x[1]"
100000 loops, best of 3: 10.4 usec per loop
yopy:->

Point to be noted:

if array grows or shrinks in the middle

  • Realloc still depends on total length.
  • But, All the trailing elements have to be copied

So, now I hope you can decide what you need to choose for your needs.

2 of 4
39

Use a list comprehension:

Scenario 1:

[item for item in my_list if 1 <= item <=5 ]

Scenario 2:

to_be_removed = {'a', '1', 2}
[item for item in my_list if item not in to_be_removed ]

Scenario 3:

[item for item in my_list if some_condition()]

Scenario 4(Nested list comprehension):

[[item for item in seq if some_condition] for seq in my_list]

Note that if you want to remove just one item then list.remove, list.pop and del are definitely going to be very fast, but using these methods while iterating over the the list can result in unexpected output.

Related: Loop “Forgets” to Remove Some Items

Discussions

del or remove to delete an item from a list
There is a practical difference between the two in general, in that list.remove gets rid of the first item that matches, scanning from left to right. If the list is very long, that can be quite expensive. The del syntax deletes the item at just a known index, and is very fast, although in this specific case the call to list.index in the author's version means that they both have the same practical effect. Generally though the del syntax can be replaced with list.pop which is much nicer to look at. There's a small argument to be made for del being slightly more general (it would work on any mutable collection that supports indexing), but it's not encountered very often in the wild. More on reddit.com
🌐 r/learnpython
9
1
May 24, 2018
How to delete all the items (in a list) beautifully?
Hello! I want to know how to delete all the items (in a list) beautifully? For example: list = [2, 3, 4] Can I just do it in this way? list = [] 🤔 Or del list[2], del list[1], del list[0] 😂 🫠Thank you for your time! More on discuss.python.org
🌐 discuss.python.org
19
0
February 10, 2024
🌐
Codefinity
codefinity.com › courses › v2 › 102a5c09-d0fd-4d74-b116-a7f25cb8d9fe › 39cc7383-2374-4f3f-b322-2cb0109e6427 › 112381fc-6ae6-4198-85ff-2e47516253c8
Learn Deleting Elements | Mastering Python Lists
Python Data Structures · Start Learning · Section 1. Chapter 8 · single · Run Code · Submit Task · Swipe to show menu · The del keyword allows you to delete an element at a specific index in the list.
🌐
StrataScratch
stratascratch.com › blog › how-to-remove-an-element-from-a-list-in-python
How to Remove an Element from a List in Python - StrataScratch
October 3, 2025 - Use del when you want to delete items by index or slice ranges. Use list comprehension when you want to remove all occurrences of a value or apply a condition. Use filter() when working with functions or filtering logic.
🌐
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)

🌐
Note.nkmk.me
note.nkmk.me › home › python
Remove an Item from a List in Python: remove, pop, clear, del | note.nkmk.me
April 17, 2025 - In Python, you can remove items (elements) from a list using methods such as remove(), pop(), and clear(). You can also use the del statement to delete items by index or slice. Additionally, list comp ...
Find elsewhere
🌐
Python.org
discuss.python.org › python help
How to delete all the items (in a list) beautifully? - Python Help - Discussions on Python.org
February 10, 2024 - Hello! I want to know how to delete all the items (in a list) beautifully? For example: list = [2, 3, 4] Can I just do it in this way? list = [] :thinking: Or del list[2], del list[1], del list[0] :joy: …
🌐
GeeksforGeeks
geeksforgeeks.org › python › remove-item-from-list-in-python
How to Remove Item from a List in Python - GeeksforGeeks
The del statement can remove elements from a list by specifying their index or a range of indices.
Published   July 15, 2025
🌐
GeeksforGeeks
geeksforgeeks.org › python › list-methods-in-python-set-2-del-remove-sort-insert-pop-extend
List Methods in Python | Set 2 (del, remove(), sort(), insert ...
# Python code to demonstrate the working of # del and pop() # initializing list lis = [2, 1, 3, 5, 4, 3, 8] # using del to delete elements from pos.
Published   April 7, 2025
🌐
Great Learning
mygreatlearning.com › blog › it/software development › how to remove an item from a list in python
How to Remove an Item from a List in Python
June 11, 2025 - You will also explore OOP concepts and objects to build robust programs. ... Using remove(): Remove a specific item by its value. Using pop(): Remove an item by its index, or the last item. Using del keyword: Remove an item by its index or a slice.
🌐
Python documentation
docs.python.org › 3 › tutorial › datastructures.html
5. Data Structures — Python 3.14.6 documentation
There is a way to remove an item from a list given its index instead of its value: the del statement. This differs from the pop() method which returns a value. The del statement can also be used to remove slices from a list or clear the entire ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › what-is-difference-between-del-remove-and-pop-on-python-lists
Difference Between Del, Remove and Pop in Python Lists - GeeksforGeeks
July 23, 2025 - del is a keyword and remove(), and pop() are in-built methods in Python. The purpose of these three is the same but the behavior is different. remove() method deletes values or objects from the list using value and del and pop() deletes values ...
🌐
Real Python
realpython.com › remove-item-from-list-python
How to Remove Items From Lists in Python – Real Python
December 23, 2024 - You use the .remove() method to delete the first occurrence of a specified value from a list. To remove all the items from a list, you use .clear(). You can also remove duplicate items using a loop, dictionary, or set.
🌐
GeeksforGeeks
geeksforgeeks.org › python › remove-an-element-from-a-list-by-index-in-python
Remove an Element from a List by Index in Python - GeeksforGeeks
July 23, 2025 - In conclusion , Python provides several methods to remove elements from a list by index, each with its own advantages and use cases. Whether you prefer a concise list comprehension, the in-place modification with the del keyword, or the specialized remove() and pop() functions, understanding ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-ways-to-remove-particular-list-element
Ways to remove particular List element in Python - GeeksforGeeks
October 15, 2025 - Raises a ValueError if the value is not found in the list. del statement is used to delete elements by their index. It can also delete a slice of the list or the entire list.
🌐
SpeedySense
speedysense.com › home › python › how to remove an item from a list in python (remove, pop, clear, del)
How to Remove an Item From a List in Python (remove, pop, clear, del)
May 18, 2023 - In Python, we use list methods remove(), pop(), and clear() to remove an item (elements) from a list. You can delete items using del statement
🌐
IncludeHelp
includehelp.com › python › python-remove-list-items.aspx
Python - Remove List Items
May 1, 2025 - In Python lists, removing items can be done using methods like remove(), pop(), or the del statement.
🌐
Programiz
programiz.com › python-programming › methods › list › remove
Python List remove()
# animals list animals = ['cat', 'dog', 'rabbit', 'guinea pig'] # Deleting 'fish' element animals.remove('fish') # Updated animals List print('Updated animals list: ', animals)