I have a nested list that is for example: A_board=[['0', '0'],['1', '1']]. And I want to take this nested list apart and get a result, which if I call print result, it would display: < 0 0 > < 1 1 >
I am not sure how to approach this with loops, I made the matrix into a list first, by doing:
boardWidth_a=len(A_board)
listLength=len(board[0])
for q in range(0,boardWidth_a):
for x in range(0, listLength):
board1D.append(int(board[q][x]));
with board1D being [0, 0, 1, 1] now, what can i do to board1D to make it into < 0 0 > < 1 1 >?
Seems a bit convoluted – can you not just do:
For n-tuples, adapt the following: