I have an string (items with comma separated) and I need to check if any of the items in the string (or list after split) are present in a long string.
I know how to do this in a long style like:
for i in people.split(","):
if i in test :
if any(x in people.split(",") for x in test) :
Use any checking if any word is in test :
if any(word in test for word in people.split(",")): # do whatever
Your logic is incorrect as you are checking test is in the split list of words which does not match your first loop.