FAQ: Learn Python - Battleship - And Seek

Community%20FAQs%20on%20Codecademy%20Python%20Exercises

This community-built FAQ covers the “And Seek” exercise in Codecademy’s lessons on Python.

FAQs for the Codecademy Python exercise eAnd Seek:

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about Python in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

Other FAQs

The following are links to additional questions that our community has asked about this exercise:

  • This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
  • Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
  • This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!

Not seeing your question? It may still have been asked before – try (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

2 posts were split to a new topic: Board indexing question

why do we need to put -1 in randint function in second parameter?
len(board) -1

1 Like

I got the following message, but can’t find a mistake in my code:

Traceback (most recent call last):
File “python”, line 24, in
ExecTimeoutException: Program took too long to terminate.

There would appear to be a infinite loop. Please show us your code.


Belay. It’s the LE timing out while the program waits for input. There is a very short time window in which to enter something at the input prompt. Refresh and try again. This time be quick.

1 Like

Amazing! Thanks! I was too slow…

1 Like

Traceback (most recent call last):
File “python”, line 15, in
ExecTimeoutException: Program took too long to terminate.

Is not accepting any int imput from keyboard

1 Like

This is an issue with using raw_input. Myself and a number of other people have submitted bug reports on this but it’s never been fixed. Getting the same issue 21/10/2021

You just have to let it fail twice and then click ‘View Solution’ in order to continue.

1 Like

Agree that this is the issue and it is still not fixed.

And it will never be fixed. The Python 2 content is not being maintained and users will just have to work around the few issues that surface, mostly pertaining to raw_input(). Don’t use it. Just code in the values and watch the code perform. Use print to show intermediate output for a better look at the process.

Python 2 is long ago sunsetted so take this opportunity to just experience the language and learn as much as you can from the free public platform. That will prepare you for Python 3 in the Pro and Student subscriptions.

Bottom line, take from this what learning experience you can and make the most of it. It’s free, and 99% of it still works.

Thanks a lot. You resolved my problem!

1 Like