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