title: Inline function with if/else: check returned value and append to list on condition, without calling function twice
body: <p>This one is hard to word. It comes from trying to understand inline functions.</p>
  
  <p>This question is a spin-off of another question I asked: <a href="https://stackoverflow.com/questions/52349830/evaluating-input-function-inline-in-order-to-append-input-or-placeholder-to-a-l">Evaluating input function inline, in order to append input or placeholder to a list</a></p>
  
  <p>I want this code to work. The idea is, to evaluate the output of a function without calling it twice - and the choice should be appended to the list if it is equal to a set value:</p>
  
  <pre><code>import random
  
  def returner():
      choices = ['cat', 'dog']
      return random.choice(choices)
  
  list = []
  list.append(returner() if returner() == 'dog' else 'got the cat in the bag')
  </code></pre>
  
  <p>The thing is, above I called the function twice. If it was a user input, it wouldn't be so great, to prompt the user twice. So I thought I could do:</p>
  
  <pre><code>list.append(x = returner() if x == 'dog' else 'got the cat in the bag')
  </code></pre>
  
  <p>Is it possible to do something like above?</p>