@josephill The problem with your code is the indentation
after your:
else:
print "You missed my battleship!"
board[guess_row][guess_col] = "X"
print_board(board)
You ignored the indentation so python is using it for your previous else
I did the mistake and got the error but after indenting it right it’s gone.
The right indentation
else:
print "You missed my battleship!"
board[guess_row][guess_col] = "X"
print_board(board)