Python List remove() Method
Example
Remove the "banana" element of the fruit
list:
fruits = ['apple', 'banana', 'cherry']
fruits.remove("banana")
Run example »
Definition and Usage
The remove()
method removes the first
occurrence of the element with the specified value.
Syntax
list.remove(elmnt)
Parameter Values
Parameter | Description |
---|---|
elmnt | Required. Any type (string, number, list etc.) The element you want to remove |