title: Python pass only parameters which are not None to a function
body: <p>I have a function with four parameters <code>a</code>, <code>b</code>, <code>c</code> and <code>d</code> as shown below.</p>
  <pre><code>def myfunc(a=None,b=None,c=None,d=None):
      
      if &lt;check which are not None&gt;:
          myfunc2(&lt;pass those which are not None&gt;)
  </code></pre>
  <p>I need to call another function <code>myfunc2</code> inside this function but with only those parameters which the user has passed in <code>myfunc</code>. For example, if the user passes values for <code>a</code> and <code>d</code> in <code>myfunc</code>, then I need to call <code>myfunc2</code> as:</p>
  <pre><code>myfunc2(a=a, d=d)
  </code></pre>
  <p>Is there a simple way to do this rather than write <code>if</code> cases for all possible combinations of <code>a,b,c,d</code>?</p>