Answers for "python binary representation of numbers"

3

binary representation python

>>> bin(88)
'0b1011000'
>>> int('0b1011000', 2)
88
>>> 

>>> a=int('01100000', 2)
>>> b=int('00100110', 2)
>>> bin(a & b)
'0b100000'
>>> bin(a | b)
'0b1100110'
>>> bin(a ^ b)
'0b1000110'
Posted by: Guest on April-17-2020
0

python binary representation of numbers

# get integer version of binary number
int(bin(8)[2:])
Posted by: Guest on May-04-2021

Code answers related to "python binary representation of numbers"

Python Answers by Framework

Browse Popular Code Answers by Language