bitwsie operator help please

David In VA me at mindspring.com
Mon Sep 17 02:38:46 CEST 2001


I am not sure how to properly write the bitwise operator but I think it 
will be useful for some thing I need to do.  If I want to print "Hello" 
if the value 2^2 (4) is in a given value (lets say testvalue) how would 
I do this?  I have been trying this

if  4 & testvalue:
	print "hello"


This isn't working.  Can someone please point me in the correct 
direction?


Tanks,
David



More information about the Python-list mailing list