Nomor penjepit di Python
def clamp(num, min, max):
if num > max:
return max
elif num < min:
return min
else:
return num
MunchDuster
def clamp(num, min, max):
if num > max:
return max
elif num < min:
return min
else:
return num