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
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_list_pop.asp
Python List pop() Method
Remove List Duplicates Reverse ... Study Plan Python Interview Q&A Python Training ... The pop() method removes the element at the specified position....
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ tutorial โ€บ datastructures.html
5. Data Structures โ€” Python 3.14.7 documentation
Remove the item at the given position in the list, and return it. If no index is specified, a.pop() removes and returns the last item in the list.
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ python โ€บ pop()
Python Pop Method: Essential Data Manipulation techniques
In Python, pop() is a list method that removes and returns an element of a list. With an argument, pop() removes and returns the item at the specified index (starting from 0).
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ list.pop and list.pop()
r/learnpython on Reddit: list.pop and list.pop()
June 27, 2024 -

This feels like one of those python weird things. I am interested in explanations.

If I have a list=[1,2,3,4] and I do list.pop() the result is list=[1,2,3].

Perfect, just what I wanted.

However, if I am not careful and instead do list.pop--note there are no parentheses this time--I get no syntax error or warning and nothing happens, leading me to a strange debug session.

In the repl, if I do l.pop it just identifies it as a built-in method of list object at 0xwhatever. That's useful, but why is there not at least a runtime warning when I make this mistake in my code?

๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-list-pop-method
Python List pop() Method - GeeksforGeeks
July 17, 2026 - DSA Python ยท Data Science ยท NumPy ยท Pandas ยท Practice ยท Django ยท Flask ยท Last Updated : 17 Jul, 2026 ยท pop() method removes an element from a list and returns the removed value.
๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ python-pop
How to Use the Python pop() Method | DataCamp
July 31, 2024 - Before going into more detail, ... Python's syntax and different functions. The pop() method is used in lists and dictionaries to remove specific items and return the value....
Find elsewhere
๐ŸŒ
YouTube
youtube.com โ€บ watch
Python pop() List Method - TUTORIAL - YouTube
Python tutorial on the .pop() list method. Learn how to pop values from lists in Python.This video is part of the new List Methods series! Subscribe to get ...
Published: October 8, 2020
๐ŸŒ
iCert Global
icertglobal.com โ€บ home โ€บ community โ€บ what is the actual difference between pop and remove methods in python list manipulation?
What is the actual difference between pop and remove methods in Python list manipulation?
November 14, 2025 - ... he core difference lies in how the element is identified. The .pop() method is index-based; it removes and returns the element at a specific position (defaulting to the last item).
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ methods โ€บ list โ€บ pop
Python List pop() (with Code Visualization)
The list pop() method removes and returns the item at a specified index. If no index is specified, pop() removes and returns the last item. Here's a quick example:...
Top answer
1 of 3
18

Are your lists large? If so, use ifilter from itertools to filter out elements that you don't want lazily (with no up front cost).

Lists not so large? Just use a list comprehension:

 newlist = [x for x in oldlist if x not in ['a', 'c'] ]

This will create a new copy of the list. This is not generally an issue for efficiency unless you really care about memory consumption.

As a happy medium of syntax convenience and laziness ( = efficiency for large lists), you can construct a generator rather than a list by using ( ) instead of [ ]:

interestingelts = (x for x in oldlist if x not in ['a', 'c'])

After this, you can iterate over interestingelts, but you can't index into it:

 for y in interestingelts:    # ok
    print y

 print interestingelts[0]     # not ok: generator allows sequential access only
2 of 3
15

You want a list comprehension:

L = [c for c in L if c not in ['a', 'c']]

Or, if you really don't want to create a copy, go backwards:

for i in reversed(range(len(L))):
    if L[i] in ['a', 'c']:
        L.pop(i)    # del L[i] is more efficient

Thanks to ncoghlan for reversed() & phooji for del L[i] suggestions. (I decided to leave it as L.pop(i), since that's how the question was initially formulated.)

Also, as J.S. Sebastian correctly points out, going backwards is space efficient but time inefficient; most of the time a list comprehension or generator (L = (...) instead of L = [...]) is best.

Edit:

Ok, so since people seem to want something less ridiculously slow than the reversed method above (I can't imagine why... :) here's an order-preserving, in-place filter that should differ in speed from a list comprehension only by a constant. (This is akin to what I'd do if I wanted to filter a string in c.)

write_i = 0
for read_i in range(len(L)):
    L[write_i] = L[read_i]
    if L[read_i] not in ['a', 'c']:
         write_i += 1

del L[write_i:]
print L
# output: ['b', 'd']
๐ŸŒ
Simplilearn
simplilearn.com โ€บ home โ€บ resources โ€บ software development โ€บ pop in python: an introduction to pop function with examples
Pop in Python: An Introduction to Pop Function with Examples
November 13, 2025 - Pop in Python is a pre-defined, in-built function. Learn pop function's โœ“ syntax โœ“ parameters โœ“ examples, and much more in this tutorial. Start learning now!
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
๐ŸŒ
Medium
medium.com โ€บ teqius โ€บ python-pop-remove-items-from-lists-dictionaries-sets-and-more-a3e59daeff45
Python Pop: Remove Items From Lists, Dictionaries, Sets, and More | by John Akhilomen | teqius | Medium
November 26, 2024 - You remove an item from the list and get a handy little reminder of what is left there โ€” sort of like removing the apples from the list and then getting a new list back without the apples in it.
๐ŸŒ
w3resource
w3resource.com โ€บ python โ€บ list โ€บ list_pop.php
Python List pop() Method
April 14, 2026 - Python List - pop() Method: The pop() method is used to remove the item at the given position in a list, and return it.
๐ŸŒ
YouTube
youtube.com โ€บ watch
#67 Pop Method in Python โ€“ Remove List Items by Index with Ease! - YouTube
๐Ÿ”น Pop Method in Python โ€“ Remove Items by Index! ๐Ÿ”นIn this Python tutorial, we explore the pop() method and how it's used to remove elements from a list by t...
Published: April 28, 2025