Python list.remove() Method

Beginner
6 min read
Updated: Nov 2026
3 examples
list method

Definition

remove(value) searches the list from left to right and deletes the first item that is equal (==) to value. Later duplicates stay where they are.

It returns None. If no item matches, it raises ValueError, so check with value in lst first or catch the exception when a missing value is normal.

list.remove() is an instance method of the built-in list type: call it on a list with dot notation, such as basket.remove(...). No import is needed.

Syntax

Pass the value to delete, not its position.

python
lst.remove(value)
CallWhat it does
["a", "b", "a"].remove("a")Returns None; the list becomes ['b', 'a'].
[1, 2].remove(1.0)Returns None; the list becomes [2], because 1.0 == 1.
[1, 2].remove(3)Raises ValueError: no item equals 3.

Pick the tool by what you know: the value, use remove(); the position, use pop() (returns the item) or del lst[i]; everything, use clear().

Method signatures
python
list.remove(value)
# returns: None; the first item equal to value is gone
# raises: ValueError when no item equals value

Parameters

ParameterDescription
valueThe value to look for. Items are compared with ==, so the match does not have to be the same object, and strings must match exactly, including case.

Return Value

Return ValueDescription
NoneAlways None. The list is one item shorter.

Python Examples

Example 1 — Take Apples Out of a Grocery Basket

The basket holds two apples. Each remove() call takes out only one, starting from the left.

python
basket = ["apple", "milk", "apple", "bread"]

basket.remove("apple")
print(basket)
print(basket.count("apple"), basket.index("apple"))

basket.remove("apple")
print(basket, "apple" in basket)

How It Works

  1. Leftmost wins. The first call deletes the apple at index 0 and leaves the second apple alone.
  2. One apple left. count() still finds one, and index() shows it has moved to position 1.
  3. Call again for the next. A second remove("apple") deletes the remaining apple.
  4. Membership check. "apple" in basket is now False.

Example 2 — Unsubscribe Email Addresses From a Mailing List

Handle an address that is not on the list, then remove every copy of a duplicated one.

python
subscribers = [
    "[email protected]", "[email protected]", "[email protected]", "[email protected]",
]

try:
    subscribers.remove("[email protected]")
except ValueError:
    print("[email protected] was not subscribed")

while "[email protected]" in subscribers:
    subscribers.remove("[email protected]")
print(subscribers)

kept = [s for s in subscribers if not s.startswith("bo")]
print(kept, len(subscribers))

How It Works

  1. Missing value raises. zed is not in the list, so remove() raises ValueError and the handler prints a friendly line.
  2. Remove every copy. The while ... in loop calls remove() until no "ann" address is left, which takes two passes here.
  3. Comprehension builds a new list. Filtering with a condition creates kept without touching subscribers; it is the usual way to drop many items at once.
  4. Original untouched. subscribers still holds two addresses after the comprehension.

Example 3 — Edit a Playlist With Four Removal Tools

Delete by value, by position with and without keeping the item, and then everything at once.

python
playlist = ["Intro", "Storm", "Tide", "Storm", "Outro"]

playlist.remove("Storm")
print(playlist)

skipped = playlist.pop(1)
print(skipped, playlist)

del playlist[0]
print(playlist)

playlist.clear()
print(playlist)

How It Works

  1. By value. remove("Storm") deletes the first Storm; the second one, further right, survives.
  2. By position, keep the item. pop(1) removes "Tide" from index 1 and returns it into skipped.
  3. By position, discard it. del playlist[0] removes "Intro" and gives nothing back.
  4. Everything. clear() empties the list in place, leaving [].

Frequently Asked Questions

No, only the first one. Call it in a while value in lst loop, or build a new list with a comprehension, to remove every match.
remove() raises ValueError. Check with value in lst first, or wrap the call in try/except ValueError.
remove() deletes by value and returns None. pop() deletes by position and returns the removed item.
Use lst.pop(i) if you want the item back, or del lst[i] if you do not. remove() always expects a value.
Each removal shifts the later items one place left, so the loop moves past the item that slid into the current position. Loop over lst[:] or use a comprehension instead.

Next: list.reverse()

Reverse the order of the items in place.

reverse() →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful