How to apply max & min boundaries to a value without using conditional statements
<p><strong>Problem:</strong></p>

<p>Write a Python function, clip(lo, x, hi) that returns lo if x is less than lo; hi if x is greater than hi; and x otherwise. For this problem, you can assume that lo &lt; hi.</p>

<p>Don't use any conditional statements for this problem. Instead, use the built in Python functions min and max. You may wish to read the documentation on min and the documentation on max, and play around with these functions a bit in your interpreter, before beginning this problem.</p>

<p>This function takes in three numbers and returns a single number.</p>

<p><strong>Code Given:</strong></p>

<pre><code>def clip(lo, x, hi):
    '''
    Takes in three numbers and returns a value based on the value of x.
    Returns:
     - lo, when x &lt; lo
     - hi, when x &gt; hi
     - x, otherwise
    '''
</code></pre>

<p><strong>My Code Added:</strong></p>

<pre><code>def clip(lo, x, hi):
    '''
    Takes in three numbers and returns a value based on the value of x.
    Returns:
     - lo, when x &lt; lo
     - hi, when x &gt; hi
     - x, otherwise
    '''
    if min(x, lo, hi) == x:
        return lo
    elif max(x, lo, hi) == x:
        return hi
    else:
        return x
</code></pre>

<p><strong>Here's the problem:</strong> I can't use <strong>ANY</strong> conditionals. Help!</p>
