Re: put multiple condition in if statement

2006-03-12 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On 10 Mar 2006 21:12:57 -0800, [EMAIL PROTECTED] declaimed the >following in comp.lang.python: > >> How can I put multiple condition in if statement? >> > Lesson one: Python is NOT C > >> I try this, but I can't g

Re: put multiple condition in if statement

2006-03-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, > > How can I put multiple condition in if statement? With "and"s and "or"s. > > I try this, but I can't get that to work. > > if ( (str != " ") && (str != "") ): FWIW, I would not hope a type to be equal to a string !-) > Any help is appreciated. "doesn'

Re: put multiple condition in if statement

2006-03-11 Thread Terry Hancock
On 10 Mar 2006 21:12:57 -0800 [EMAIL PROTECTED] wrote: > How can I put multiple condition in if statement? > I try this, but I can't get that to work. > > if ( (str != " ") && (str != "") ): if s!=' ' and s!='': 1) logical operators are words 2) don't overload standard type names this is actual

Re: put multiple condition in if statement

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 21:47:33 -0800, Alex Martelli wrote: > <[EMAIL PROTECTED]> 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 t

Re: put multiple condition in if statement

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 21:12:57 -0800, Allerdyce.John 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 != "") ): >>> if ( (str != " ") && (str != "") ): File "", line 1 if ( (str != " ") && (str !

Re: put multiple condition in if statement

2006-03-10 Thread Alex Martelli
<[EMAIL PROTECTED]> 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