remove items by index python 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 list remove at index
a = ['a', 'b', 'c', 'd']
a.pop(1)
# now a is ['a', 'c', 'd']