Just learning Python, so finding the answer for this hard to find as I'm not sure what to type in! I think the answer will use Itertools.
I have a list (of length L) with 1 starting number (could be any positive integer, n) and the rest zeros. EG L=4 n=3:
[3,0,0,0]
and I want all combinations that the 3 can be split into the spaces in the list. EG:
[[3,0,0,0],[2,1,0,0],[2,0,1,0],[2,0,0,1],[1,2,0,0],[1,0,2,0],[1,0,0,2],[1,1,1,0],[1,1,0,1],[1,0,1,1],[0,3,0,0],[0,2,1,0],[0,2,0,1],[0,1,2,0],[0,1,0,2],[0,1,1,1],[0,0,3,0],[0,0,2,1],[0,0,1,2],[0,0,0,3]]
Thanks for taking the time to read :)