Hey dudes/gales I've been really struggling in the recent chapters, and I don't know what to do, I've been for the last few exercises getting stuck and I've had to check the forum for the answer, and I'm not satisfied with that, I feel like I don't understand why I'm doing x or y, should I restart the whole thing to try and have a better understanding or just keep going one and redo the whole things when I finish ?
btw what's wrong with this code ? It's supposed to remplace the "O" by "X" but it doesn't seem to want to.
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) print_board(board) def random_row(board): return randint(0, len(board) - 1) def random_col(board): return randint(0, len(board) - 1) ship_row = random_row(board) ship_col = random_col(board) print ship_row print ship_col guess_row = int(raw_input("Guess Row:")) guess_col = int(raw_input("Guess Col:")) # Write your code below! if guess_row == ship_row and guess_col == ship_col: print "Congratulations! You sank my battleship!" else: print "You missed my battleship!" board [int(guess_row)] [int(guess_col)] = "X" print_board(board)