It's a type of Planche
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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)