Nylithius Nylithius - 3 months ago 11
Python Question

set time limitations for timer

Is there are nicer way to write the code like this?

# ugly piece of code
seconds = 0 if seconds < 0 else seconds
seconds = 86399 if seconds >= 86400 else seconds


I mean - I need to setup the strict possible range of seconds

Answer
seconds = max(0, min(86399, seconds))