I am trying to remove specific characters from items in a list, using another list as a reference. Currently I have:
forbiddenList = ["a", "i"]
tempList = ["this", "is", "a", "test"]
sentenceList = [s.replace(items.forbiddenList, '') for s in tempList]
print(sentenceList)
which I hoped would print:
["ths", "s", "test"]
of course, the forbidden list is quite small and I could replace each individually, but I would like to know how to do this "properly" for when I have an extensive list of "forbidden" items.