remove value from array python by value code example
Example 1: python list remove item by value
l = ['Alice', 'Bob', 'Charlie', 'Bob', 'Dave']
print(l)
# ['Alice', 'Bob', 'Charlie', 'Bob', 'Dave']
l.remove('Alice')
print(l)
# ['Bob', 'Charlie', 'Bob', 'Dave']
Example 2: python remove one element from array
array = ["red", "green", "blue"]
del array[0] # this deletes the first element, red, in the array