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
Not sure how to explain it in words so I hope it's clear. Thanks