13. Not Again!


#1



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"
else:
    print "You missed my battleship!"
    board[guess_row][guess_col] = "X"
    print print_board(board)


#2

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


#3

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


#4

Will need to see your complete program code.


#5

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