On Sat, 22 Oct 2005, Joe Bennett wrote:

> Anyone know of a good explanation of either how to perform boolean math 
> in Python? What I am trying to do is AND two numbers together:
> 
> e = 51 AND 15
> 
> 00110011
> 00001111
> ------------
> 00000011 

Use '&' rather than "AND":

>>> e = 51 & 15
>>> e
3


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to