title: Python: list comprehension, do f(x) if x exists?
body: <p>How can I do something like the following in Python?</p>
  
  <pre><code>row = [unicode(x.strip()) if x for x in row]
  </code></pre>
  
  <p>Basically, a list comprehension where you carry out a function if the variable exists.</p>
  
  <p>Thanks!</p>