I have a several lists within a list which forms a game of noughts and crosses:
list = [
['X', 'O', 'O'],
['O', 'X', 'O'],
[' ', 'X', ' ']
]
I need to write a function that returns the diagonals of the game from top left to bottom right and then top right to bottom left so the output would be:
diags = (['X', 'X', ' '],['O', 'X', ' '])
I have tried various combinations of nested for loops, can't seem to get my head around it though.