python how to delete item from list code example
Example 1: python remove element from list
myList.remove(item)
myList.pop(i)
Example 2: remove element from list
>>> a = [0, 2, 3, 2]
>>> a.remove(2)
>>> a
[0, 3, 2]
Example 3: remove value from python list by value
>>> a = ['a', 'b', 'c', 'd']
>>> a.remove('b')
>>> print a
['a', 'c', 'd']
Example 4: delete from list python
list.remove(element)
Example 5: delete items from python list
l = list(range(10))
print(l)
del l[0]
print(l)
del l[-1]
print(l)
del l[6]
print(l)