Battleship


#1

Hello, I am have a very hard time with python, battleship section. In the 12th section of the battleship I do understand the question, but every time I type a code it doesn't work.

First I did: if guess_row not in range(5) or guess_col not in range(5):
print "Oops, that's not even in the ocean."

But it didn't work.

Than, I did 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!"
guess_row, guess-col == "X"
print_board(board)

Than that didn't work.

Finally I did:

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

It didn't work.

So I am not sure what to do, I need help


#2

please post your full code, which version you think is closest to the correct solution, please markup:

so your indention shows


#3

mybe you can try "if guess_row not in range(5) and guess_col not in range(5): "


#4

The full code is: 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":
else:
print "You missed my battleship!"
guess_row, guess_col == "X"
print_board(board)


#5

did you see the format topic i posted? Please read it, so we can see your indent, its important


#6

I don't get it. This is the full code.


#7

yes, but you should post the code with markup:

so we can see your indent of your code


#8

The code is:

`
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":
else:
print "You missed my battleship!"
print_board(board)

`


#9

don't include spaces between the backticks

your code has no indent at all? That can't be right


#10

I am not sure what the question asks.


#13