Is there a more pythonic way to achieve this:
result = #...real value from elsewhere
max_value = 1
min_value = 0
if result > max_value:
result = max_value
elif result < min_value:
result = min_value
return result
I donβt know how to explain it in words, so I hope it is clear. Thanks
source
share