title: Is if/else/if possible in list comprehension?
body: <p>I'd like to know if it is possible to use a list comprehension with <code>if</code>/ <code>else</code> that need not result in a list of the same length as the length of the list being processed? (ie. without the final <code>else</code>)</p>
  
  <pre><code>&gt;&gt;&gt; L = [0, 1, 2, 3, 4, 5, 6]
  &gt;&gt;&gt; [v * 10 if v &lt; 3 else v * 2 if v &gt; 3 else v for v in L] #if/else/if/else
  [0, 10, 20, 3, 8, 10, 12]
  </code></pre>
  
  <p>works fine. But suppose I want to omit the 3, to get:</p>
  
  <pre><code>[0, 10, 20, 8, 10, 12]  # No number 3
  </code></pre>
  
  <p>I would have thought this would work:</p>
  
  <pre><code>&gt;&gt;&gt; [v * 10 if v &lt; 3 else v * 2 if v &gt; 3 for v in L] #if/else/if
  </code></pre>
  
  <p>But it is a syntax error..</p>
  
  <p>So I thought 'maybe' this would work:</p>
  
  <pre><code>&gt;&gt;&gt; [v * 10 if v &lt; 3 else v * 2 if v &gt; 3 else pass for v in L] #if/else/if/else pass
  </code></pre>
  
  <p>But it doesn't..</p>
  
  <p>This is a curiosity question, I realise this is not neccessarily the most readable/appropriate approach to the above processing.</p>
  
  <p>Am I missing something? Can it be done?
  (I'm on python 2.6.5)</p>