Answers for "python remove item by value"

3

delete element from list value

>>> a=[1,2,3]
>>> a.remove(2)
>>> a
[1, 3]
>>> a=[1,2,3]
>>> del a[1]
>>> a
[1, 3]
>>> a= [1,2,3]
>>> a.pop(1)
2
>>> a
[1, 3]
>>>
Posted by: Guest on May-19-2020
5

python remove by index

a = [0, 1, 2, 3, 4, 5]
el = a.pop(2)
Posted by: Guest on March-05-2020

Code answers related to "python remove item by value"

Python Answers by Framework

Browse Popular Code Answers by Language