In what you executed on the shell, List
is made up of lists [1,1,1]
and [1,1,1]
, not tuples. Hence doing List = [[0] + x for x in List]
works without errors.
Where as in your code, list(itertools.permutations(List,config.number))
returns a list of tuples, like:
[(2, 4, 8, 5, 11, 10, 9, 3, 7, 6), (2, 4, 8, 5, 11, 10, 9, 6, 3, 7),...]
which explains the error.
Doing this:
config.permutations = [[1] + list(x) for x in config.permutations]
fixes the issue.