It's a type of Planche
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. def clamp(n, minn, maxn):
  4. """Clamp a number between a max and a min value.
  5. :param n: Number to clamp.
  6. :param minn: Minimum number to allow.
  7. :param maxn: Maximum number to allow.
  8. """
  9. return max(min(maxn, n), minn)