I have one question


I have one question.
When I click the "save & submit code" button, I can type in the first row number, but I can't type in the second col number. No any character or number appear, does anybody know why?
(My browser is Chrome, but my system is XP)

Battleship....and SEEK

Hi @blogwhiz63750,

To answer your question, we will need to see your 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[0]) - 1)

ship_row = random_row(board)
ship_col = random_col(board)

Add your code below!

guess_row = int(raw_input("Guess Row: "))
guess_col = int(raw_input("Guess Col: "))

I think the code is good, maybe it's the browser's problem.


Your code works perfectly in my browser, which is Chrome on a MacBook Air with Mac OS X Lion 10.7.5. See below:

After you type in a response to the Guess Row: prompt, you need to hit the return/enter key, then type in a response to the Guess Col: prompt, and hit the return/enter key again. Is that what you tried to do?


@appylpye Thank you! I use another computer( windows 10) and it works!!
I think the version of Chrome on windows XP is too old.:laughing: