python remove list items code example
Example 1: python remove element from list
myList.remove(item) # Removes first instance of "item" from myList
myList.pop(i) # Removes and returns item at myList[i]
Example 2: how to delete list python
# delete by index
a = ['a', 'b', 'c', 'd']
a.pop(0)
print(a)
['b', 'c', 'd']
Example 3: delete a value in list python
list.remove(element)
Example 4: remove value from python list by value
>>> a = ['a', 'b', 'c', 'd']
>>> a.remove('b')
>>> print a
['a', 'c', 'd']