So I have a set of 11 variables that I want to assign the numbers 1 to 11 using python. I want to then iterate through all combinations of these assignments and check they complete a series of tests. The 6 tests are such that 6 different combinations of the variables (including a separate 12th variable that retains a constant value (12)) are tested to see if they add to 26. For a permutation to be successful, all combinations must add to 26.
To simplify, say it was just 3 variables assigned the numbers 1-3 I want the program to output a=1,b=2,c=3 then to check this against the criteria before changing the order to a=1,b=3,c=2. Check then change: a=2,b=1,c=3 check and change etc until all combinations have been checked.
I first considered using a list to store the numbers 1 to 11 then just randomising the list order using the shuffle function. I’m not sure how else to iterate through the combinations. The random nature of shuffle would eventually do the job but it would be very slow and certainly not an elegant solution.
Thanks for any help in advance :)