I need to understand the working of random_row and random_col functions.
def random_row(board): return randint(0, len(board) - 1) def random_col(board): return randint(0, len(board) - 1)
1. How does the length of Grid calculated? If the Grid is 4*5 (4 rows and 5 columns) then what would be the length?
2. Why are we subtracting the length?
3. In the random_col function why are we including index 0 while subtracting from 1, and doing the same for random_row function?
Thanks in advance for help