Problem:
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, y
solution:
def clip(lo, x, hi): x = max(lo, x) x = min(x, hi) return x