and becomes or and or becomes and

Thomas 'PointedEars' Lahn PointedEars at web.de
Sun May 22 17:57:11 EDT 2011


Stef Mientki wrote:

> must of us will not use single bits these days,
> but at first sight, this looks funny :
> 
>>>> a=2
>>>> b=6
>>>> a and b
> 6
>>>> a & b
> 2
>>>> a or b
> 2
>>>> a | b
> 6

Change the order of the operands and see what happens.

-- 
PointedEars

Bitte keine Kopien per E-Mail. / Please do not Cc: me.



More information about the Python-list mailing list