[Tutor] What does ^ and | mean?

tee chwee liong tcl76 at hotmail.com
Fri Jan 28 16:09:20 CET 2011


hi,
 
i'm confuse on how does ^ and | mean. When i tried |, i thought it is addition but 4|4 also give 4?
>>> 4|2
6
>>> 4|1
5
>>> 4|3
7
>>> 4|4
4
 
When i tried ^, looks like subtraction but 2^4 gives 6?
 

>>> 2^3
1
>>> 2^2
0
>>> 2^4
6
 
Pls help to clear my confusion. thanks.
 
 
 
 
  		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110128/ac6d5373/attachment.html>


More information about the Tutor mailing list