Deleting item from list

l = [1,2]

You need to do:

l.remove(1)

To delete 1 from the list


del(l[1]) will delete the item at index 1 not the actual element with value 1

Leave a Comment