delete every element in list by value python code example
Example 1: how to delete list python
# delete by index
a = ['a', 'b', 'c', 'd']
a.pop(0)
print(a)
['b', 'c', 'd']
Example 2: python list remove all elements
l = [1,2,3,4]
l.clear()
# delete by index
a = ['a', 'b', 'c', 'd']
a.pop(0)
print(a)
['b', 'c', 'd']
l = [1,2,3,4]
l.clear()