Battleship "Not Again!" 13/19


#1

<Battleship Not Again!>
Don’t understand why round brackets are needed for the Elife statement

<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

Hi Guys,

For this exercise, i believed i had the correct code originally, but it didn’t work since i did not put round brackets

What I did:

elif board[guess_row][guess_col] == ‘X’:
print “You guessed that one already.”

What the correct code was:

elif (board[guess_row][guess_col] == ‘X’):
print “You guessed that one already.”

```python

Replace this line with your code.

<do not remove the three backticks above>

#2

It should work either way. When the parentheses surround the entire expression, they have no effect on its evaluation.


#3

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