title: Python inline if when setting variable
body: <p>In Java, setting a variable to a value based on a condition could be done in one line 
  like so:</p>
  
  <pre><code>variable = (!true) ? 1 : 2
  </code></pre>
  
  <p>This would result to '2'.</p>
  
  <p>Is there python equivalent to this code?</p>
  
  <p>Thank you.</p>