I have a list: the_board = [['','',''], ['','',''], ['','','']]
.
It will be updated with X's and O's, but I need to make a list which contains a tuple of the indexes that don't have an X or an O.
For example, if the list had an 'X' at index the_board[1][2]
, the new list should be like: free_fields = [(0,0), (0,1), (0,2), (1,0), (1,1), (2,0), (2,1), (2,2) #note how index [1][2] is not a tuple in the new list.
How would I go about doing this? Thanks.