I have a list of news titles and would like to check if any title contains any of the keywords in a list.
e.g.
newstitle =['Python is awesome', 'apple is tasty', 'Tom cruise has new movie']
tag = ['Python','Orange', 'android']
If any keywords in tag
are in newstitle
, I want it to return True
.
I know how to do it with a single tag using:
any('Python' in x for x in newstitle)
But how to do it with multiple keywords?