[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
c = 21
print 'All inbounds', all(10 <= x <= 21 for x in (b, c))
print 'None inbounds', all(not 10 <= x <= 21 for x in (b, c))
print 'inbounds', [x for x in (b, c) if 10 <= x <= 21]
print 'outabounds', [x for x in (b, c) if not 10 <= x <= 21]
I do advise working through the tutorial before asking.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list