a1 = ' '
a2 = ' '
a3 = ' '
b1 = ' '
b2 = ' '
b3 = ' '
c1 = ' '
c2 = ' '
c3 = ' '
boardspace = [[a1,a2,a3],[b1,b2,b3],[c1,c2,c3],[a1,b1,c1],[a2,b2,c2],[a3,b3,c3],[a1,b2,c3],[a3,b2,c1]]
while x != 'a'
a1 = '0'
a2 = '0'
a3 = '0'
for a in baordspace:
if a[0]==a[1]==a[2]!= " "
x ='a'
如您所见,列表将始终打印"" "" ""
a1
a2
a3
永远不会'0'
在for循环中,这是为什么呢?
但是,如果您打印a1
它是,'0'
但是[a1,a2,a3]
"" "" ""