Skip to content

Instantly share code, notes, and snippets.

Created December 25, 2012 10:15
Show Gist options
  • Save anonymous/4372527 to your computer and use it in GitHub Desktop.
Save anonymous/4372527 to your computer and use it in GitHub Desktop.
def p(x, bound1, bound2):
return min(max(x, bound1), bound2)
if __name__ == '__main__':
print(p(5, 2, 7))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment