ef clip(lo, x, hi): ''' Takes in three numbers and returns a value based on the value of x. Returns: - lo, when x < lo - hi, when x > hi - x, otherwise '''
ef clip(lo, x, hi): ''' Takes in three numbers and returns a value based on the value of x. Returns: - lo, when x < lo - hi, when x > hi - x, otherwise ''' if min(x, lo, hi) == x: return lo elif max(x, lo, hi) == x: return hi else: return x
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)