I don't know what is wrong with my syntax. Please help me out
This is my error:
File "python", line 15
def random_col(board):
SyntaxError: invalid syntax

from random import randint 

board = []

for x in range(0, 5):
    board.append(["O"] * 5)

def print_board(board):
    for row in board:
        print " ".join(row)

def random_row(board):
    return randint(0,len(board-1)

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


In both random_row and random_col you are missing a closing parentheses after randint.
Change this

return randint(0,len(board-1)

To this

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


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