Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: Hi. I'm having another go at learning Python so I'll probably be asking a few basic questions. Here is the first one. I think nobody has pointed out to you that "a < b < c" has the conventional mathematical definition (b is between a and c). So, perhaps: b = 9

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread [EMAIL PROTECTED]
On Dec 8, 11:12 am, Tim Chase <[EMAIL PROTECTED]> wrote: > > a = list(range(10, 21)) > > > b = 9 > > > c = 21 > > > How can I find out if b and c have values less or more than the values > > in list a? > > Sounds like a good use for 2.5's addition of the any() and all() > functions -- you don't men

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread [EMAIL PROTECTED]
Wow. Thanks Eric and Peter. Very helpful indeed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread Tim Chase
a = list(range(10, 21)) b = 9 c = 21 How can I find out if b and c have values less or more than the values in list a? Sounds like a good use for 2.5's addition of the any() and all() functions -- you don't mention whether you want your variable compared against *any* of the list items or *

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Hi. I'm having another go at learning Python so I'll probably be > asking a few basic questions. Here is the first one. > > a = list(range(10, 21) > > b = 9 > > c = 21 > > How can I find out if b and c have values less or more than the values > in list a? >>> a = ra

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread eric
On Dec 8, 11:44 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi. I'm having another go at learning Python so I'll probably be > asking a few basic questions. Here is the first one. > > a = list(range(10, 21) > > b = 9 > > c = 21 > > How can I find out if b and c have values less or more tha

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread [EMAIL PROTECTED]
Found it. min and max functions. I thought that this would be implemented as a list method: a.min a.max I can see that the built in functions make sense. -- http://mail.python.org/mailman/listinfo/python-list