7/19 help

def random_row(board):
    return randint(0, len(board) - 1)

def random_col(board):
    return randint(0, len(board[0]) - 1)

Why there is a "[0]' in fourth line?


Each element in the list board represents a row, and in each row there is one element for each column.
So the number of columns can be found by looking at how many elements there are in a row.



Found answer here! Thanks.



You won't be able to change the board size


This is the one that works if anyone needs it...
def random_row(board):
ship_row = randint(0,len(board) - 1)
return ship_row
def random_col(board):
ship_col = randint(0, len(board) - 1)
return ship_col

I didn't at 0,4 and also there is no need for random