Nov-24-2020, 07:42 PM
I've never heard of a single function that does that operation. I don't see anything wrong with your function as a solution. If you were golfing, you could reduce it to
return min(max(n,a),b)but if your objection to the first is how it reads, I don't think that's an improvement.