13/19 Did you remember to add the "You guessed... error


#1

Write your code below!

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

And it displays the error: "Oops, try again. Did you remember to add the "You guessed that one already." message in your elif statement?"

why is that? Can somebody help me?


#2

Note the full stop at the end of the string.


#3
# Write your code below!
if guess_row == ship_row and guess_col == ship_col:
    print "Congratulations! You sank my battleship!"
else:
    print "You missed my battleship!"  
    board[guess_row][guess_col]= "X"
    print print_board(board)
    if 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)

Ok right now it looks like this and its still wrong


#4

I had the same problem.

Include the period in "You guessed that one already."


#5

Check your indentation on:
if 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)
Remove the spaces behind the elif and else statements


#6

What say you about your own post? Where is the indentation in your example?