Python -- Only pass arguments if the variable exists
<p>I have the following variables that a user can optionally submit through a form (they are not required, but may do this to filter down a search).</p>

<pre><code>color = request.GET.get ('color')
size = request.GET.get ('size')
</code></pre>

<p>Now I want to pass these variables to a function, but only if they exist. If they do not exist I want to just run the function without arguments.</p>

<p>the function without arguments is:</p>

<pre><code>apicall = search ()
</code></pre>

<p>with color only it's</p>

<pre><code>apicall = search (color)
</code></pre>

<p>and with color and size it's</p>

<pre><code>apicall = search (color, size)
</code></pre>

<p>If the argument is defined I want to pass it to the function, but if it's not I do not want to pass it.</p>

<p>What is the most efficient way to do that? Does python have built-in methods for this?</p>
