The hexadecimal number 0xB15 = 2837 has the binary representation 0b101100010101. So if your input is a hexadecimal number, you need to tell Python to convert the string
"B15" which comes out of
input() into the hexadecimal number
0xB15, also known as the decimal number
2837, before you can convert it into binary for output.
BASE = 16 a = int(input(), BASE) print(bin(a)[2:]) # Cut of the first two characters '0b'
CLICK HERE to find out more related problems solutions.