So, I am trying to find all the elements in the 0'th position of my 2D array in python. I am wanting to do this in a way as such so that I can iterate through said array. My Array is as such:
board = [["1", "O", "O", "O", "O", "O", "O"],
["2", "O", "O", "O", "O", "O", "O"],
["3", "O", "O", "O", "O", "O", "O"],
["4", "O", "O", "O", "O", "O", "O"],
["5", "O", "O", "O", "O", "O", "O"],
["6", "O", "O", "O", "O", "O", "O"]]
What I am trying to achieve is the output of ["1", "2", "3", "4"], ["2", "3", "4", "5], ["3", "4", "5", "6"], and so forth for the following columns.
The method that I have tried is as such: print(board[0:4][0]), but this only outputs the very first row of the array: ['1', 'O', 'O', 'O', 'O', 'O', 'O']. Is there any way I could do this as simply or as easily in a single line like the method previously stated?
Thanks in Advance.