remove specific item from list python code example
Example 1: delete a value in list python
list.remove(element)
Example 2: remove value from python list by value
>>> a = ['a', 'b', 'c', 'd']
>>> a.remove('b')
>>> print a
['a', 'c', 'd']
Example 3: how to delete a particular element from a list in python
# animals list
animals = ['cat', 'dog', 'dog', 'guinea pig', 'dog']
# 'dog' is removed
animals.remove('dog')
# Updated animals list
print('Updated animals list: ', animals)