I am trying to run the following program as part of my other program
n=2
array=[[[[[[['*' for col in range(6)] for col in range(n)] for col in range(n)] for col in range(n)] for row in range(n)] for row in range(n)]for row in range(n)]
possible=[[[[[[[] for col in range(n)] for col in range(n)] for col in range(n)] for row in range(n)] for row in range(n)] for row in range(n)]
possible[0][0][0][0][0][0]=[['a', 'f', 'b', 'c', 'd', 'e'], ['a', 'f', 'b', 'c', 'e', 'd'], ['a', 'f', 'b', 'd', 'c', 'e'], ['a', 'f', 'b', 'e', 'c', 'd'], ['a', 'f', 'c', 'b', 'd', 'e'], ['a', 'f', 'c', 'b', 'e', 'd'], ['a', 'f', 'd', 'b', 'c', 'e'], ['a', 'f', 'e', 'b', 'c', 'd'], ['a', 'f', 'c', 'd', 'b', 'e'], ['a', 'f', 'c', 'e', 'b', 'd'], ['a', 'f', 'd', 'c', 'b', 'e'], ['a', 'f', 'e', 'c', 'b', 'd'], ['a', 'e', 'b', 'f', 'c', 'd'], ['a', 'e', 'b', 'c', 'f', 'd'], ['a', 'e', 'c', 'f', 'b', 'd'], ['a', 'e', 'c', 'b', 'f', 'd'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e']]
array[1][0][0][0][0][0]=['a', 'b', 'f', 'd', 'e', 'c']
array[0][0][0][0][0][0]=['*', '*', 'f', 'c', 'd', '*']
r=[]
for s in range(6):
if s!=0:
if array[0][0][0][0][0][0][s]!='*':
r.append(s)
x=[]
for y in range(6):
if y!=0:
if array[1][0][0][0][0][0][y]!='*':
x.append(y)
t=list(set(x).intersection(set(r)))
for j in t:
if (array[1][0][0][0][0][0][j]!=array[0][0][0][0][0][0][j]):
for i in possible[0][0][0][0][0][0]:
if i[0]==array[1][0][0][0][0][0][0]:
possible[0][0][0][0][0][0].remove(i)
Output is
[['a', 'f', 'b', 'e', 'c', 'd'], ['a', 'f', 'e', 'b', 'c', 'd'], ['a', 'f', 'e', 'c', 'b', 'd'],
['a', 'e', 'c', 'b', 'f', 'd'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'],
['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'],
['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'],
['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'], ['f', 'a', 'b', 'c', 'd', 'e'],
['f', 'a', 'b', 'c', 'd', 'e']]
print(possible[0][0][0][0][0][0])
should not have any list starting with 'a'. I don't understand what I am doing wrong.