I have a script that iterates through a list of files in a directory. Based on words inside the filenames, it would categorize them into three groups. To complicate things, there are now exceptions to this. The exceptions are in a list. My problem is that I can't get it to check for "any" of the items in the list, and if not there, continue to categorize. The excepted word can be anywhere in the filename. I can get it to find things in the list and do something using a for loop, but it'll then move to the next iteration and ignore the previous excepted word and categorize it incorrectly.
This is how I want it to work, but the any( doesn't work like this apparently.
exceptions = ["one", "two", "three"]
for i in filenames:
if any(exceptions) in i:
do this
else:
do this