Play it Sam


#1

Continuing the discussion from Not Again:

<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/python-beginner-en-4XuFm/2/1?curriculum_id=4f89dab3d788890003000096

<In what way does your code behave incorrectly? Include ALL error messages.>
I receive a way to go after the lesson. I played a few more guesses and then I received an error message;
Oops, try again. Did you remember to print out turn + 1 each turn?

if I continue to enter numbers I will eventually receive a way to go. I don’t know if my code is correct or not can someone check to see what is wrong?

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:
    for turn in range(3):
        if turn==3:
            print "Game Over"
        else:
            print "You missed my battleship!"
            board[guess_row][guess_col] = "X"
            print "Turn", turn+1
        
# Print (turn + 1) here!
    print (turn+1) 

    print_board(board)

<What do you expect to happen instead?>

```python

Replace this line with your code.

<do not remove the three backticks above>

#2

never mind I got to game over and it works every time I don’t know why but it works. thanks anyway.


#3

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