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

Scott David Daniels Scott.Daniels at Acm.Org
Tue May 20 00:12:45 EDT 2008


notnorwegian at yahoo.se 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
Scott.Daniels at Acm.Org



More information about the Python-list mailing list