Hi everyone, I'm getting an error code in exercise 7 of python Battleship
return randint(0, len(board) - 1): ^ SyntaxError: invalid syntax
I have absolutely no clue as to why this is happening, my code should work fine.
here's the code
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)): random_row(board) random_col(board)
Thanks in advance