Remove the 0b in binary
It's easy just make this function:
def f(n):print('{:0b}'.format(n))
f(17)
>>> 10001
use python string slice
operation.
a = bin(17)
b = bin(17)[2:]
to format this to 8-bits use zfill
.
c = b.zfill(8)
Use slice operation to remove the first two characters.
In [1]: x = 17
In [2]: y = bin(x)[2:]
In [3]: y
Out[3]: '10001'