title: Pass functional arguments through ternary operator in Python
body: <p>This might be a basic question because I am still learning Python. But let's suppose I want to do something like this,</p>
  <pre><code>def add(a, b):
      return a + b
  
  a, b, c, d = 1, 2, 3, 4
  sum = add(a, b if b == 2 else c, d)
  </code></pre>
  <p>Basically, I am trying to pass multiple functional args from inside a ternary operator(and I want a similar solution, if possible). This code currently gives the following error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  TypeError: add() takes 2 positional arguments but 3 were given
  </code></pre>
  <p><strong>What else have I tried:</strong></p>
  <ul>
  <li><code>add((a, b) if b == 2 else (c, d))</code></li>
  <li><code>add(*(a, b) if b == 2 else *(c, d))</code></li>
  </ul>