Number in a range

  • Thread starter Thread starter LanceM
  • Start date Start date
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top