data = ["my web portal is not working","online is better than offline", "i like going to pharmacy shop for medicines"]
words = ["web", "online"]
I want to iterate over sentences and check if any of words present in list words. If yes I want a single category for each sentence else category "other". It is working if I am giving single word from the words list, but I want to check all words in single run.
b = []
def ch_1(x,y):
for i in x:
if y in i:
b.append("web")
else:
b.append("others")
return b
Getting error :
in ' requires string as left operand, not list