On Wed, Mar 16, 2011 at 1:24 AM, Donald Bedsole <drbeds...@gmail.com> wrote:

>
> Ok, so, as another example:
>
> not(True and False) is "True"
>
> because: the first argument "True" is true, and the second argument
> "False" when returned is negated by "not" becomes "not False" which
> evaluates to True?
>
>
Correct.  When Python sees (True and False) it first evaluates True, which
is obviously True.  Because the first argument was not False, it continues
on and evaluates False.  At this point Python stops evaluating anything else
(for example if you had (True and False and True)) and returns False, which
is then negated by 'not'.


-- 
Jack Trades
Pointless Programming Blog <http://pointlessprogramming.wordpress.com>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to