Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

delete element of a list from another list python

l1 = ["a", "b", "c", "d", "e", "f"]
l2 = ["b", "c", "e"]

l1 = [elt for elt in l1 if elt not in l2]
# l1 = ['a', 'd', 'f']
 
PREVIOUS NEXT
Tagged: #delete #element #list #list #python
ADD COMMENT
Topic
Name
5+9 =