For example i have 2 lists:
a = ['podcast', 'podcasts', 'history', 'gossip', 'finance', 'business', 'kids', 'motivation', 'news', 'investing']
b = ['podcast', 'history', 'gossip', 'finance', 'kids', 'motivation', 'investing']
I want to find items in list a
that are not in the list b
I try to do it like this:
c = []
for _ in a:
if _ not in b:
c.append(_)
All that I try ends with something like this:
Initially, I have a text file with keywords:
podcast
podcasts
history
gossip
finance
Also for almost all keywords I have text files with information:
podcast.txt
podcasts.txt
history.txt
I need to find which files I am missing I load a list of keywords like this:
a = []
with open("keywords.txt", "r") as f:
text = f.read().split("\n")
for k in text:
a.append(k)
b = [e.replace(".txt", "") for e in os.listdir("profiles/")]