bitwsie operator help please

Grant Edwards grante at visi.com
Tue Sep 18 14:18:16 EDT 2001


In article <MPG.160f1025af35e968989741 at nntp.mindspring.com>, David In VA wrote:
> 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"

It works for me.  How exactly is it not working?

-- 
Grant Edwards                   grante             Yow!  FOOLED you! Absorb
                                  at               EGO SHATTERING impulse
                               visi.com            rays, polyester poltroon!!



More information about the Python-list mailing list