Lista Pythona remove() Metoda
Przykład
Usuń element „banan” z fruit
listy:
fruits = ['apple', 'banana', 'cherry']
fruits.remove("banana")
Definicja i użycie
Metoda remove()
usuwa pierwsze wystąpienie elementu o określonej wartości.
Składnia
list.remove(elmnt)
Wartości parametrów
Parameter | Description |
---|---|
elmnt | Required. Any type (string, number, list etc.) The element you want to remove |