This bin()
function returns an integer converted into a binary string.
bin(integer)
Here,
Note: If the number is not a Python int object, it has to define an __index__()
method that returns an integer
>>> bin(1)
'0b1'
>>> bin(1024)
'0b10000000000'
>>> bin(0b0111 + 0b1000)
'0b1111'