0

I am trying to make a connect 4 board that is of any size, here is the code:

row = [] 
board = [] 
empty = "-" 
  
numOfRows = int(input("Rows: ")) 
numOfCs = int(input("Columns: ")) 
  
for i in range(0, numOfCs): 
    row.append(empty) 
     
for i in range(0, numOfRows): 
    board.append(row) 
  

print(board)

board[4][1] = "R"

print(board)

And it prints (if the board is big enough) the list, but in for some reason it replaces "R" for all of the columns in the list, how can I make it only replace the singular value?

martineau
  • 119,623
  • 25
  • 170
  • 301
wondercoll
  • 339
  • 1
  • 4
  • 15

0 Answers0