I wish to split some representative 64-bits elements of a python list into another python list composed by individual hexadecimals.
Input:
['4d5a900003000000', '04000000ffff0000', ...]
Desired output:
['4', 'd', '5', ..., '0', '4', '0', ...]
I wish to split some representative 64-bits elements of a python list into another python list composed by individual hexadecimals.
Input:
['4d5a900003000000', '04000000ffff0000', ...]
Desired output:
['4', 'd', '5', ..., '0', '4', '0', ...]
You can use a list comprehension:
s = ['4d5a900003000000', '04000000ffff0000']
new_s = [i for b in s for i in b]
Output:
['4', 'd', '5', 'a', '9', '0', '0', '0', '0', '3', '0', '0', '0', '0', '0', '0', '0', '4', '0', '0', '0', '0', '0', '0', 'f', 'f', 'f', 'f', '0', '0', '0', '0']