I think you are confused about what a binary is. Binary and decimal numbers are just different representations of a number - for example. 101 base 2 and 5 base 10 are the same. The operations of adding, subtracting and comparing work with numbers - 101 base 2 == 5 base 10, and adding is the same logical operation, regardless of which base you work in. The fact that your python interpreter can store things as binary internal ones doesn't affect how you work with it - if you have an integer type, just use +, - etc.
If you have strings of binary digits, you will either have to write your own implementation or convert them using the int (binaryString, 2) function.
Steven Schlansker Oct 06 '09 at 3:44 2009-10-06 03:44
source share