I need to create a string that returns the characters from the column of the board with index column_index as a single string.
I need to return the below
>>> make_str_from_column([['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']], 1)
'NS
I had initially done
def makedef make_str_from_column(board, column_index):
""" (list of list of str, int) -> str """
if column_index >=0:
return board[0][column_index] +board[1][column_index]
however, I cannot use the 0 and 1 these are really just hardcoded to get me to the answer I want
I am a bit lost on how to replace the 0 and 1