missing 'xor' Boolean operator

Miles Kaufmann milesck at umich.edu
Wed Jul 15 19:57:20 CEST 2009


On Jul 15, 2009, at 1:43 PM, Jean-Michel Pichavant wrote:

> Hrvoje Niksic wrote:
> [snip]
>> Note that in Python A or B is in fact not equivalent to not(not A and
>> not B).
>>
> >>> l = [(True, True), (True, False), (False, True), (False, False)]
> >>> for p in l:
> ...     p[0] or p[1]
> [snip]
> Did I make twice the same obvious error ?


Try again with:

l = [('foo','bar'), ('foo', ''), ('', 'bar'), ('', '')]

-Miles




More information about the Python-list mailing list