title: A Python one liner? if x in y, do x
body: <pre class="lang-py prettyprint-override"><code>numbers = [1,2,3,4,5,6,7,8,9]
  number = 1
  </code></pre>
  
  <p>Can I write the following on one line?</p>
  
  <pre class="lang-py prettyprint-override"><code>if number in numbers:
      print number
  </code></pre>
  
  <p>Using the style of ruby:</p>
  
  <pre class="lang-rb prettyprint-override"><code>puts number if numbers.include?(number)
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre class="lang-py prettyprint-override"><code>print number if number in numbers
  </code></pre>
  
  <p>But the syntax is invalid.</p>