Feb-16-2018, 11:52 PM
Hi fellows.
I just started to learn python but I am stuck with this problem.
I have to create a function:
def clip(lo, x, hi).
The function takes in three numbers and returns a value based on the value of x. Returns:
-lo, when x < lo
-hi, whtn x > hi
-x, otherwise.
The problem for me is that we do not have to use -for this problem- any conditional statements. Instead, we have to use the built in python functions min() and max().
I do not know how to do it....yet.
thanks!
high_existence
I just started to learn python but I am stuck with this problem.
I have to create a function:
def clip(lo, x, hi).
The function takes in three numbers and returns a value based on the value of x. Returns:
-lo, when x < lo
-hi, whtn x > hi
-x, otherwise.
The problem for me is that we do not have to use -for this problem- any conditional statements. Instead, we have to use the built in python functions min() and max().
I do not know how to do it....yet.
thanks!
high_existence