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']
# Basic syntax:
my_list.remove(element) # or:
my_list.pop(index)
# Note, .remove(element) removes the first matching element it finds in
# the list.
# Example usage:
animals = ['cat', 'dog', 'rabbit', 'guinea pig', 'rabbit']
animals.remove('rabbit')
print(animals)
--> ['cat', 'dog', 'guinea pig', 'rabbit']
# Note only the first instance of rabbit was removed from the list.
# Note, if you want to remove all instances of an element (and it's the only
# duplicated element), you could convert the list to a set then back to a
# list, and then run .remove(element) E.g.:
animals = list(set['cat', 'dog', 'rabbit', 'guinea pig', 'rabbit'])
animals.remove('rabbit')
print(animals)
--> ['cat', 'dog', 'guinea pig']
myList = ["Bran", 11, 33,"Stark"]
del myList[2] # output: [‘Bran’, 11, ‘Stark’]