title: Python: How to check if two lists are not empty
body: <p>In Python, I know the pythonic way to check if a list is empty is</p>
  
  <pre><code>if not a:
      # do things with empty list
  </code></pre>
  
  <p>To check if a list is not empty then, we would do:</p>
  
  <pre><code>if a:
      # do things with my list
  </code></pre>
  
  <p>How would we check, simultaneously (as read), if two lists then are not empty?</p>
  
  <pre><code>if a and b:
      # do things with my two lists
  </code></pre>
  
  <p>The above does not seem to work, and I'm unsure what <code>(a and b)</code> actually means. For <code>a = [2]</code>, <code>b = [1,3]</code>, <code>(a and b) = [1,3]</code>. What is the <code>and</code> operator actually doing here? If I end up reducing <code>b = []</code> at some point, <code>(a and b) = []</code> even though <code>a</code> is not empty.</p>
  
  <p>Edit: My use case goes something like</p>
  
  <pre><code>while (a and b are not empty):
      modify a
      modify b
  </code></pre>
  
  <p>I would have naively thought that since <code>if a</code> checks if a list is not empty, <code>if a and b</code> would check if neither were empty, which is not the case.</p>