put multiple condition in if statement

Alex Martelli aleaxit at yahoo.com
Sat Mar 11 00:47:33 EST 2006


<Allerdyce.John at gmail.com> wrote:

> Hi,
> 
> How can I put multiple condition in if statement?
> 
> I try this, but I can't get that to work.
> 
> if ( (str != " ") && (str != "") ):

Why would you WANT to conjoin two instances of the SAME check...?!

Anyway, use 'and' -- there's no such thing as '&&' in the Python
language!


Alex



More information about the Python-list mailing list