title: Put for if in one line python
body: <p>Say i have one list:</p>
  
  <pre><code>v=['one','','two','three','',]
  </code></pre>
  
  <p>Now i want to filter out all the empty values:</p>
  
  <pre><code>for i in v:
    if i==''
      pass
    else:
      print(i)
  </code></pre>
  
  <p>I want to do this in one line :</p>
  
  <pre><code>vr=[i if i!='' else pass for i in v]
  </code></pre>
  
  <p>getting bellow error.</p>
  
  <pre><code> File "&lt;console&gt;", line 1
   vr=[i if i!='' else pass for i in vt1]
                       ^
   SyntaxError: invalid syntax
  </code></pre>
  
  <p>Kindly suggest .</p>