I have the following list:
listEx = ['123','456','342','432']
How can I take the different compilations of numbers that can be made? For example for the first item of the list 123
the compilation should be:[1,2,3]
,[1,23]
,[12,3]
,[123]
The first compliation can be done by using the following:
[int(listEx[0][0]),int(listEx[0][1]),int(listEx[0][2])]
[int(listEx[0][0]),int(listEx[0][1:])]
.
.
.
Is there a more elegant and dynamic way of doing it ? More speciffically how can i create the following:
[[[1,2,3],[4,5,6],[3,4,2],[4,3,2]],
[[1,23],[4,56],[3,42],[4,32]],
.
.
]