A certainl part of an if() structure never gets executed.

Νικόλαος Κούρας support at superhost.gr
Wed Jun 12 16:00:27 EDT 2013


On 12/6/2013 10:48 μμ, Sibylle Koczian wrote:
>> if '=' not in ( name and month and year ):
>> i understand: if '=' not in name AND '=' not in month AND '=' not in year
>>
> Wrong. The "'=' not in (...)" first evaluates the expression in
> parentheses, that's what parentheses are for. And then it looks for '='
> in the result. And that result is just one of the three values, MRAB
> told you which one.

okey first the expression eval:

( name and month and year ) = ( name=True and month=True and year=True )

then if '=' not in (name = True and month = True and year = True)

I still do not follow how this works. it just doesn't make any sense to 
me at all.


if '=' not in ( name and month and year ):
if '=' not in ( name or month or year ):

I try to read both of them them as an English sentence but i cannot.
how can you be able to understand this?





More information about the Python-list mailing list