title: One line Boolean check in Python
body: <p>I am a relatively newer Python developer, but I come from a Java background. In Java, there is one-line Boolean checker/assigner (for lack of a better term):</p>
  
  <pre><code>int result = (x)?y:z;
  </code></pre>
  
  <p>I am trying to use a similar approach in Python, but I am not sure whether this structure exists. Is there a way to declare a variable, check whether a condition is true and assign it to one of two values without using if/else?</p>