I was using the if any(word in 'x' for word in list):
into a cycle in order to know if any of some words (in a list) were in specific texts in order to discard the ones for which none of the words was present. It used to work pretty fine but, from a couple of months ago the conditional expression starts to give always positive results.
For example:
list=['home','cat']
if any(word in "my home is red" for word in list):
print "YES"
YES
if any(word in "my hair is red" for word in list):
print "YES"
YES
But the second conditional is supposed to show me a negative result. I didn't change anything in my previous code but anyway I can be making some stupid mistake which someone could help me?