The code in the bottom adds hexadecimal numbers to a list in the format:
['0x0', '0x1', ..., '0xa', '0xb', ..., '0xab', ...]
How can I have the single digit hexadecimal numbers have a leading zero, like this:
'0x0' '0x0a'
The code:
K = 256
keys = list(itertools.product([0, 1], repeat=8))
for poss in range(K):
keys[poss] = hex(int(''.join(map(str, keys[poss])), 2))