missing 'xor' Boolean operator

Hrvoje Niksic hniksic at xemacs.org
Wed Jul 15 16:00:52 EDT 2009


Jean-Michel Pichavant <jeanmichel at sequans.com> writes:

> 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]
[...]

Try with a different data set, for example:

>>> 10 or 20
10
>>> not(not 10 and not 20)
True



More information about the Python-list mailing list