title: Nested / serial if expressions?
body: <p>Can I do more complex <code>if expressions</code> than strict <code>a = b if c else d</code>. Can I string together serial expressions, or nest an <code>if expression</code> inside another <code>if expression</code>?  I cannot find an answer in the docs or online.</p>
  
  <p>CONTEXT (some of it is only relevant to explain why I am seeking this, rather than another solution):     </p>
  
  <ul>
  <li><p>I have two scalar variables (<code>a</code> and <code>c</code>) that either have an actual value or are set to -1. If they have a value this is always true <code>c - a = 2</code> (they are list indexes, for specific items in a list, but the items are not always present. </p></li>
  <li><p>If either <code>a</code> or <code>c</code> has a value other than -1 , then I want to create a third scalar variable <code>b</code> that has a specific value (the value between <code>a</code> and <code>c</code>).</p></li>
  <li>if neither <code>a</code> nor <code>c</code> has a value, then I want to set <code>b = -1</code></li>
  </ul>
  
  <p>so would ideally write something like this: </p>
  
  <p><code>b = a+1 if a != -1 else c-1 if c != -1 else -1</code> </p>
  
  <p>I cannot figure out if this is allowed - legal. And if it is legal, does it get evaluated sequentially? An alternative specification would be hierarchical:</p>
  
  <p><code>b = (a+1 if a != -1 else c-1) if (c != -1 or a != -1) else -1</code> </p>
  
  <p>Is either of these legal? Advisable? Thanks.</p>