I have been working on a coding project in python. The issue is that if i run my code for the time needed it would take a lifetime. I have identified the code that is making it take so long but i don´t know how to make it faster.

The code:

while True:
        # print(r)
        boatpos = list(
            map(lambda x: boatpos[x] + boatinfo[x][1], range(boats)))
        place = list(map(lambda x: x if boatpos[x] <= 0 else 0, range(boats)))
        if place == list(range(boats)):
  • we won't answer 3rd party projects – onurcano22 Apr 18 at 18:00
  • ask on stackoverflow – ivanivan Apr 19 at 3:58
  • 1
    That's stackoverflow.com BUT< you can make this on topic if you know that what you want to do is called profiling and reword your question to ask for a Python profiler. – Mawg Apr 19 at 6:26
  • 1
    As a new user, you might also want to be aware of codereview.stackexchange.com where experienced programmers will critique your code. Mention that you are concerned about seed and you should get help – Mawg Apr 19 at 6:27
  • 1
    Btw, welcome aboard & good luck. We are getting a lot of off-topic questions suddenly - could you tell us why you chose this site to post? It would help us to help others if we knew. F.y.i if you click the question mark at the top right of an Stack Exchange site, you can find out what is on topic – Mawg Apr 19 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.