Name

constrain()

Examples
print(constrain(55, 30, 70)) # Prints "55"
print(constrain(100, 30, 70)) # Prints "70"
print(constrain(-15, 30, 70)) # Prints "30"
Description Constrains a value to not exceed a maximum and minimum value.
Syntax
constrain(amt, low, high)
Parameters
amtint, or float: the value to constrain
lowint, or float: minimum limit
highint, or float: maximum limit
Related max()
min()
Updated on Tue Jul 11 06:52:23 2017.
Creative Commons License