Conversation

Jarkko Sakkinen

Edited 1 year ago

printing hex in the #python shell:

>>> val = bin(0x1119e)[2:]
>>> ' '.join(list(map(lambda i: val[i:i + 4], range(0, len(val), 4))))
'1000 1000 1100 1111 0'

#note

1
0
0
i like more traditional calls rather than fancy set theory alike syntax
1
0
0

Jarkko Sakkinen

Edited 1 year ago

OK, a bit more intensive to get the spacing right (or readable):

>>> ' '.join(list(map(lambda x: x[::-1], list(map(lambda i: val[::-1][i:i + 4], range(0, len(val), 4)))[::-1])))
'1 0001 0001 1001 1110'
0
0
0