title: How do I check if both of two variables exists in Python?
body: <p>I want to write a statement like this javascript in Python:</p>
  
  <p><code>if (variable1 &amp;&amp; variable2) {
      // do something only if both variables exist
  }</code></p>
  
  <p>I'm trying:</p>
  
  <p><code>if not (variable1 and variable2) is None:
      # do something only if both variables exist</code></p>
  
  <p>but it isn't working...when I debug, variable 2 is not defined but the function still tries to run. What's going wrong?</p>