L = [[0,0,3,3], [0,4,2,0], [5,0,0,1], [1,2,1,2]] #magic domino
The first part of code:
import itertools
L1 = list(itertools.product('012345', repeat = 4))
L2 = [list(x) for x in L1 if sum( int(i) for i in x) == 6]
print (L2) # all rows if sum(i) = 6
second part of code
.???????
Created at: 2018/01/18 21:12; Updated at: 2018/01/19 20:26
The question is resolved.