python - Convert hex to binary - Stack Overflow

PHOTO EMBED

Mon Jun 22 2020 13:35:43 GMT+0000 (Coordinated Universal Time)

Saved by @Amna #python

>>> format(integer, '0>42b')
'001010101111000001001000111110111111111111'
content_copyCOPY

Use the builtin function, format Then pass to format.

https://stackoverflow.com/questions/1425493/convert-hex-to-binary