Python


#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

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