title: How to match multiple words(per string) in array with a string containing multiple words
body: <p><strong>This has been resolved. See bottom of this post for a solution</strong></p>
  
  <p>I'm trying to filter out a continuous loop that has a constant feed of strings coming in(from an API).</p>
  
  <p>Heres an example of the code I'm using -</p>
  
  <p>I have a filter set up with an array like so:</p>
  
  <pre><code>filter_a = ['apples and oranges', 'a test', 'bananas']
  </code></pre>
  
  <p>a function I found on Stackoverflow like this:</p>
  
  <pre><code>def words_in_string(word_list, a_string):
      return set(word_list).intersection(a_string.split())
  title = 'bananas'
  #(this is a continuously looping thing, so sometimes it 
  # might be for example 'apples and oranges')
  </code></pre>
  
  <p>And my if statement:</p>
  
  <pre><code>if words_in_string(filter_a, str(title.lower())):
      print(title.lower())
  </code></pre>
  
  <p>For some reason it would detect 'bananas' but not 'apples and oranges'. It will skip right over strings with multiple words. I'm guessing it's because of the split() but I'm not sure.</p>
  
  <p><strong>Edit:</strong>
  Here's another example of what I meant:</p>
  
  <p>Match this and make it successful:</p>
  
  <pre><code>title = 'this is 1'
  
  word_list = ['this is','a test']
  
  if title in word_list:
      print("successful")
  else:
      print("unsuccessful")
  </code></pre>
  
  <p><strong>Edit 2:</strong></p>
  
  <h2>Solution</h2>
  
  <p>title = 'this is 1'</p>
  
  <p>word_list = ['this is','a test']</p>
  
  <p>if any(item in title for item in word_list):
      print("successful")
  else:
      print("unsuccessful")</p>