title: List comprehension with condition
body: <p>I have a simple list.</p>
  
  <pre><code>&gt;&gt;&gt; a = [0, 1, 2]
  </code></pre>
  
  <p>I want to make a new list from it using a list comprehension.</p>
  
  <pre><code>&gt;&gt;&gt; b = [x*2 for x in a]
  &gt;&gt;&gt; b
  [0, 2, 4]
  </code></pre>
  
  <p>Pretty simple, but what if I want to operate only over nonzero elements?</p>
  
  <p>'if' needs 'else' in list comprehensions, so I came up with this.</p>
  
  <pre><code>&gt;&gt;&gt; b = [x*2 if x != 0 else None for x in a]
  &gt;&gt;&gt; b
  [None, 2, 4]
  </code></pre>
  
  <p>But the desirable result is.</p>
  
  <pre><code>&gt;&gt;&gt; b
  [2, 4]
  </code></pre>
  
  <p>I can do that this way</p>
  
  <pre><code>&gt;&gt;&gt; a = [0, 1, 2]
  &gt;&gt;&gt; def f(arg):
  ...     for x in arg:
  ...         if x != 0:
  ...             yield x*2
  ... 
  &gt;&gt;&gt; list(f(a))
  [2, 4]
  </code></pre>
  
  <p>or using 'filter' and a lambda</p>
  
  <pre><code>&gt;&gt;&gt; a = [0, 1, 2]
  &gt;&gt;&gt; list(filter(lambda x: x != 0, a))
  [1, 2]
  </code></pre>
  
  <p>How do I get this result using a list comprehension?</p>