| 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 |
| ||||||
| Related |
max() min() |
Updated on Tue Feb 27 14:07:12 2024.
If you see any errors or have comments, please let us know.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License