I want to convert the String Entered convert into BCD.
a = '2015'
''.join(format(int(c), '04b') for c in str(int(a, 16)))
is giving me '1000001000010011'
. But I want it to read 0010 0000 0001 0011
as in unpacked BCD format. Can anyone help me with this?