“Hex zu binärem Python3” Code-Antworten

Python konvertiert Hex in binär

my_hexdata = "1a"

scale = 16 # equal to hexadecimal

bin(int(my_hexdata, scale))[2:].zfill(len(my_hexdata)*4)
# By changing the parameter of the zfill function we allow for any length of
# hexadecimal code, which is more useful when using this code.
Rolkin

Hex zu binärem Python3

my_hexdata = "1a"

scale = 16 ## equals to hexadecimal

num_of_bits = 8

bin(int(my_hexdata, scale))[2:].zfill(num_of_bits)
CodeHelper

Ähnliche Antworten wie “Hex zu binärem Python3”

Fragen ähnlich wie “Hex zu binärem Python3”

Weitere verwandte Antworten zu “Hex zu binärem Python3” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen