Skip to content

Instantly share code, notes, and snippets.

@chrene
Created July 19, 2014 10:32
Show Gist options
  • Save chrene/141519089e399c0d6cba to your computer and use it in GitHub Desktop.
Save chrene/141519089e399c0d6cba to your computer and use it in GitHub Desktop.
def minMax(lower, upper, n):
return max(lower, min(upper, n))
print minMax(0, 100, 100) == 100
print minMax(0, 100, 101) == 100
print minMax(0, 100, -1) == 0
print minMax(0, 100, 101) / 100;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment