Bad Aim


#1



https://www.codecademy.com/en/courses/python-beginner-en-4XuFm/1/3?curriculum_id=4f89dab3d788890003000096


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


#2

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


#3

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


#4

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


#5

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)


#6

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