13. Not Again!


I don't know what i did wrong

if guess_row == ship_row and guess_col == ship_col:
    print "Congratulations! You sank my battleship!"
elif guess_row not in range(5) or guess_col not in range(5):
    print "Oops, that's not even in the ocean."
elif board[guess_row][guess_col] == "X":
    print "You guessed that one already"
    print "You missed my battleship!"
    board[guess_row][guess_col] = "X"
    print print_board(board)


Remove print from this line. The function handles the printing.


Ok, i did that but i still get the same error
it says " You missed my battleship!" instead of "You guessed that one already"


Will need to see your complete program code.


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