Bad Aim


Oops, try again. Make sure you print "Oops, that's not even in the ocean." if the user guesses a row or column that is off the board.

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


strings printed should be an exact match, for example you string is missing the full stop (.) at the end. Might be more mistakes in there, check it or copy it from the instructions


So i have to put a (.) at the end of the string?


WOW! thanks didn't even know that, that was a thing


Yes and no, you have to make sure the string printed is an exact match, the . was just to indicate that the string was not an exact match (so yes, you have to add it), but i am not going to look for all characters to see if they match, you can do that (or just copy the string from the instructions)


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