title: how to check for multiple words in a list of string?
body: <p>I have a folder containing multiple files and I am looking for a file that contains only &quot;Low&quot; and &quot;1 Hour&quot;. So to read all those file addresses I am using the glob library.</p>
  <pre><code>import glob
  path = glob.glob(&quot;summary output\*.xlsx&quot;)
  print(path)
  </code></pre>
  <p>output:</p>
  <pre><code>summary output\2030 and 2030 High RE with 1 Hour storage.xlsx
  summary output\2030 and 2030 High RE with 2 Hour storage.xlsx
  summary output\2030 and 2030 High RE with 4 Hour storage.xlsx
  summary output\2030 and 2030 High RE with 6 Hour storage.xlsx
  summary output\2030 and 2030 Low RE with 1 Hour storage.xlsx
  summary output\2030 and 2030 Low RE with 2 Hour storage.xlsx
  summary output\2030 and 2030 Low RE with 4 Hour storage.xlsx
  summary output\2030 and 2030 Low RE with 6 Hour storage.xlsx
  </code></pre>
  <p>These are the list of files in that <code>summary output</code> folder. Now I want a file which contains <code>Low</code> and <code>1 Hour</code>, basically this file:</p>
  <pre><code>summary output\2030 and 2030 Low RE with 1 Hour storage.xlsx
  </code></pre>
  <p>so for this I wrote this:</p>
  <pre><code>for file in path:
      if &quot;Low&quot;  and &quot;1 Hour&quot; in file:
          print(file)
  </code></pre>
  <p>output:</p>
  <pre><code>summary output\2030 and 2030 High RE with 1 Hour storage.xlsx
  summary output\2030 and 2030 Low RE with 1 Hour storage.xlsx
  </code></pre>
  <p>I don't know why its taking the first file so can anyone please help?</p>