Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: 'break' outside loop (python, line 35)

if guess_row == ship_row and guess_col == ship_col:
    print "Congratulations! You sunk my battleship!"


What's preventing you from fixing it? You seem to have identified the problem.


yes, but no matter what I try, it keeps giving me an error message


Maybe you're trying things that don't make sense. What is your break supposed to accomplish? Surely that says a lot on its own about what you need to change. Or if it doesn't, then maybe you haven't considered what break does at all, if that's the case then the next thing to do is find out more about that keyword. Don't just try things. Decide what you want to make happen and then implement that in code using only what you know what it does, and if you need more than that then you need to find out more until you know what that does so that you can put it to use and write something that makes sense, something that will run.


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