title: Is there a simpler way to change how a function works depending on inputs?
body: <p>I have a function that I want to do/output something different depending on what inputs I give it. I've made something useful with <code>if else</code> logic but not elegant and I suspect there might be a shorter/more elegant way of doing it. What are the alternatives to the <code>if else</code> on <code>None</code> methods I've made?</p>
  <p>e.g.,</p>
  <pre><code>def foo (a=None, b=None, c=None):
      if a is None:
          raise ValueError(&quot;a cannot be None!&quot;)
      elif all([b is None, c is None]):
          x = operations
          return x
      elif c is None:
          x = operations
          y = operations
          return x, y
      elif b is None:
          x = operations
          z = operations
          return x, z
      elif all([b is not None, c is not None]):
          x = operations
          y = operations
          z = operations
          return x, y, z
  </code></pre>