Hi @dempancakes,

The Battleship! board is a square, so the number of rows is equal to the number of columns. However, in Exercise 19, Extra Credit, you are invited to ...

... add on to your Battleship! program to make it more complex and fun to play ...

You could decide to modify the board so that it becomes a rectangle in which the number of rows is different from the number of columns. Then the `random_row`

and `random_col`

functions would need to detect the number of rows and number of columns, directly, as appropriate. It is an example of good program design to code the functions that way.

The `board`

object is a `list`

of `list`

s. Specifically, it is `list`

of rows, each of which is a `list`

of cells within that row. The indexes of the rows are numbered from `0`

to `len(board) - 1`

, so in the `random_row`

function, we use this to choose a row randomly ...

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

Each of the cells in a row is part of a column. The first row is `board[0]`

. Regardless of the size of the board, we can assume we will have a row `0`

. The indexes of the columns in that row are numbered from `0`

to `len(board[0]) - 1`

, so this is the correct way, in the `random_col`

function, to choose a column within that row, randomly, or within any row, so long as the board is rectangular ...

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