MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/pythonhelp/comments/ydn4w6/what_does_that_mean/itt773p/?context=3
r/pythonhelp • u/ab624 • Oct 26 '22
what does x^=3 when x=5 mean ?
it evaluates to 6
3 comments sorted by
View all comments
4
^ is the "bitwise xor" operator.
^
0101 (decimal 5) XOR 0011 (decimal 3) = 0110 (decimal 6)
https://en.wikipedia.org/wiki/Bitwise_operation#XOR
1 u/ab624 Oct 26 '22 cool, thanks
1
cool, thanks
4
u/socal_nerdtastic Oct 26 '22
^is the "bitwise xor" operator.https://en.wikipedia.org/wiki/Bitwise_operation#XOR