Skip to content
List Methods

remove()

Remove the first matching value from the list.

list.remove(value)

list.remove() searches for value and removes its first occurrence from the list.

It modifies the list in place and shifts subsequent elements to close the gap. Raises ValueError if not found.

Parameters

NameDescription
valueThe value to remove from the list.

Returns

None — the list is modified in place.

Try it

Run it and change it
languages = ["Python", "C++", "Java", "Python"]
languages.remove("Python")
print(languages)

Worth knowing

  • Removes only first match: If duplicates exist, only the first occurrence is removed. To remove all occurrences, use a list comprehension: [x for x in list if x != value].
  • ValueError: Raises ValueError if the item is not present in the list.

Related entries