Searching for two or more words in string - Python Troubleshooting Program
<p>I know the code for searching words in a string that match to another string.</p>

<pre><code>if any(word in problem for word in keyword_virus):
    #Some code her e.g. pc_virus()
</code></pre>

<p>But is there any code that would allow me to check if two or more words matched/or even any modifications to this code?</p>

<p>Thank you :)</p>

<p>If I understand your question correctly, I'd rewrite the for loop to check every word in your checklist and append each match.</p>

<pre><code>matches = []
for word in check_list:
  if word in problem_list:
    matches.append(word)
</code></pre>

<p>You'll end up with a list of words that match, from which you can count the occurrence of each word.</p>

python variables if-statement search