9/19 and 10/19 bug


#1

The auto-populated code: length of board[0] - 1 returns an error. It should just be board - 1

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


#2

Please do tell how we subtract 1 from a list?

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

Looks to be in order.


#3

My bad, I meant len(board[0] -1) should be len(board) - 1. Not subtracting 1 from a list.

I had the following and passed:
def random_col(board):
return randint(0, len(board) - 1)


#4

But that restricts us to a square board. What happens if we want a 40 X 20 board?


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.