remove one list from list of lists python code example
Example 1: 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']
Example 2: python remove element from list
myList.remove(item) # Removes first instance of "item" from myList
myList.pop(i) # Removes and returns item at myList[i]