This one should not be too hard but, its giving me trouble:
Lets say I have two lists:
list1 = ['the sky is blue', 'I am happy', 'Where is the car', 'lets eat here']
list2 = ['the','', 'Where', 'lets']
What I am trying to do is compare list 1 and 2, and if the contents of list2 matches anything in list1, those characters will be removed from the member of the list.
for each new member, I would like it to be added to a new list that for now will be empty
list3 = []
list one can remain intact, but the important part is that list 3 should be the following:
list3 = ['sky is blue', 'I am happy', 'is the car', 'eat here']
Notice that the first word is removed in list 3 because that word matched when comparing list1 and list2. Hope this makes sense.
for laughs here what I tried...
list1 = ['the sky is blue', 'I am happy', 'Where is the car', 'lets eat here']
list2 = ['the','', 'Where', 'lets']
list3 = []
for w in list2:
if w in list1:
addthis = list1.remove(w)
list3.append(addthis)
Thanks