title: Python: Tell if the argument passed to a function is a constant or is a variable
body: <p>I want to create a function that would behave differently depending on how the input is passed to it.</p>
  <p>For example:</p>
  <pre class="lang-py prettyprint-override"><code>def my_func(a):
     if is_constant_input(a): # Does something like this conditional exist?
        print(f&quot;A constant input {a} was passed&quot;)
     else:
        print(f&quot;A variable input {a} was passed&quot;)
  </code></pre>
  <p>then I call the function in two ways.</p>
  <p>First way:</p>
  <pre class="lang-py prettyprint-override"><code>val = [1, 2, 3]
  my_func(val) # A variable input [1, 2, 3] was passed.
  </code></pre>
  <p>Second way:</p>
  <pre class="lang-py prettyprint-override"><code>my_func([1, 2, 3]) # A constant input [1, 2, 3] was passed.
  </code></pre>
  <p>I want to know if there's a way to implement that <code>is_constant_input()</code> conditional?</p>
  <p>EDIT: fixed the example by using an mutable argument (e.g., a <code>list</code>)</p>