Answers for "binary and in python"

0

how to calculate binary AND, OR, XOR in python

>>> # this example swaps integers without a temporary variable using XOR
>>> a = 2
>>> b = 8
>>> a ^= b
>>> b ^= a
>>> a ^= b
>>> a
8
>>> b
2
Posted by: Guest on March-24-2020

Python Answers by Framework

Browse Popular Code Answers by Language