what does clamp() function do?!

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By slightly_seasoned

Insert Title Here

:bust_in_silhouette: Reply From: timothybrentwood
float clamp(value: float, min: float, max: float)

Clamps value and returns a value not less than min and not more than max.

a = clamp(1000, 1, 20) # a is 20
a = clamp(-10, 1, 20)  # a is 1
a = clamp(15, 1, 20)   # a is 15