I have this output: ['0100', '0100'] and I wanted to have something like this [[0,1,0,0],[0,1,0,0]].
How can I do?
Try:
lst = ["0100", "0100"] out = [[int(ch) for ch in s] for s in lst] print(out)
Prints:
[[0, 1, 0, 0], [0, 1, 0, 0]]