Battleship not again!


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-python/lessons/battleship/exercises/not-again?action=lesson_resume

<In what way does your code behave incorrectly? Include ALL error messages.>

File “python”, line 39
elif(board[guess_row][guess_col] == “X”):
^
SyntaxError: invalid syntax

<What do you expect to happen instead?>

```python

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_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."
else:
print "You missed my battleship!"
elif(board[guess_row][guess_col] == “X”):
print “You guessed that one already.”

<do not remove the three backticks above>

#2

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