I have this list of decimal values
[97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112] // more and more...
How to split it in this way :
[[97,98,99,100],[101,102,103,104],[105,106,107,108],[109,110,111,112]]
then convert the decimal values to string so it can be like this
['abcd','efgh','ijkl','mnop']
>Solution :
You can do it with list comprehension:
a = [97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112]
[''.join(chr(j) for j in a[i:i+4]) for i in range(0, len(a), 4)]
Output:
['abcd', 'efgh', 'ijkl', 'mnop']