I have a list of strings generated from a text file and I need to test an input string to see if it has any of the words in my list. I then need to store the matching string/strings so that they can be used later. Currently I am using
has_words = any(string in op_text for string in words)
but I believe this only returns true/false.