def random_row(board):

return randint(0, len(board) - 1)

def random_col(board):

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

Here the codeacademy system uses functions like above, How they define the random functions differently?

Plus, I do not fully understand how the length function in the second random definitions works? Anyone explain?