Here's a simple list comp approach:
def f(l1, l2):
return [x for x in l1 if x not in l2]
l1 = ['a', 'b', 'c', 'd', 'e', 'f']
l2 = ['b', 'c', 'e']
print(f(l1, l2))
>>> ['a', 'd', 'f']
Here are a few more (using a filter you can say):
f = lambda l1, l2: list(filter(lambda elem: elem not in l2, l1))
If you want to modify the original list:
def f(l1, l2):
for elem in l2:
l1.remove(elem)
return l1
l1 = ['a', 'b', 'c', 'd', 'e', 'f']
l2 = ['b', 'c', 'e']
print(l1) # Prints ['a', 'b', 'c', 'd', 'e', 'f']
print(f(l1, l2)) # Modifies l1 and returns it, printing ['a', 'd', 'f']
print(l1) # Prints ['a', 'd', 'f'] (notice the list has been modified)
If you need strings (and not lists as posted in your question), here's another lambda:
s1 = 'abcdef'
s2 = 'bce'
# Both of the below work with strings and lists alike (and return a string)
fn = lambda s1, s2: "".join(char for char in s1 if char not in s2)
# Or, using filter:
fn = lambda s1, s2: "".join(filter(lambda char: char not in s2, s1))
print(fn(s1, s2)
>>> 'adf'