Created
November 7, 2021 09:40
-
-
Save crowjdh/3b9b670b321c4e6ca306d03362e1ccfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hex_to_bin_repr(hex): | |
a = bin(int(hex, 16))[2:] | |
b = ''.join(list(reversed(a))) | |
return ' '.join(list(reversed([''.join(list(reversed(b[i:i+4]))) for i in range(0, len(b), 4)]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment