have a question.
list1 = ['the quick brown fox', 'brown fox', 'fox']
list2 = ['the', 'james went to the library', 'james']
For list1, would like to remove 'brown fox' and 'fox' since it exists in list1[0]. For list2, would like to remove 'james' and 'the' from the list since it exists in list2[1]
How do I do a check for this? The order for the terms in the list may be given in any order. Have a large number of lists as such so would appreciate the answers.
Have tried to do a for loop, going through the list but got stuck on the logic part.
for x in range(len(list1)):
if list1[x] in list1: ## got stuck here on the logic.