Re: test mult vars to same value, how to shorten expr?

2008-05-20 Thread castironpi
On May 20, 2:08 am, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >  if i want o test: > > if a == 5 and b ==5 and c==5 ... z==5 > > > is there some synctactic suagr for this? > > > rather than maiking one of my own i mean, something built-in like: > > if a,b,c... z == 5: > >

Re: test mult vars to same value, how to shorten expr?

2008-05-20 Thread Peter Otten
[EMAIL PROTECTED] wrote: > if i want o test: > if a == 5 and b ==5 and c==5 ... z==5 > > is there some synctactic suagr for this? > > rather than maiking one of my own i mean, something built-in like: > if a,b,c... z == 5: if all(x == 5 for x in a,b,c,...): print "yep" Peter -- http://mai

Re: test mult vars to same value, how to shorten expr?

2008-05-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 May 2008 20:36:45 -0700, notnorwegian wrote: > if i want o test: > if a == 5 and b ==5 and c==5 ... z==5 > > is there some synctactic suagr for this? > > rather than maiking one of my own i mean, something built-in like: > if a,b,c... z == 5: Since Python 2.5 there's `all()`: In [81

Re: test mult vars to same value, how to shorten expr?

2008-05-19 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: if i want o test: if a == 5 and b ==5 and c==5 ... z==5 is there some synctactic suagr for this? rather than maiking one of my own i mean, something built-in like: if a,b,c... z == 5: How about: if 5 == a == b == c == ... z: ... --Scott David Daniels [EM

test mult vars to same value, how to shorten expr?

2008-05-19 Thread notnorwegian
if i want o test: if a == 5 and b ==5 and c==5 ... z==5 is there some synctactic suagr for this? rather than maiking one of my own i mean, something built-in like: if a,b,c... z == 5: -- http://mail.python.org/mailman/listinfo/python-list