Number in a range

L

LanceM

Stupid question here...Is there a built in function that will tell me if a
passed number is between two other numbers? Example

inrange(2,1,3) = True
inrange(1,2,3) = False

I can write it if I have to but I'd think that's already in place.

Thanks
 
M

Marshall Barton

LanceM said:
Stupid question here...Is there a built in function that will tell me if a
passed number is between two other numbers? Example

inrange(2,1,3) = True
inrange(1,2,3) = False

I can write it if I have to but I'd think that's already in place.


That's too simple to rate a function, builtin or otherwise.
Just use the expression:
(low <= num And num <= high)
 
Top