I am entering my own code in one of the DataCamp exercises, but I keep seeing an error message saying, "Your code took too long to execute." The exercise crashes and I am unable to move on.
In situations like this, it is very likely that you have an infinite (runaway) loop in your code. An infinite or runaway loop is a piece of code that indefinitely repeats itself because there is no code telling it to stop. This can cause a program, or in this case, the DataCamp exercise to time out.
Check if you have an infinite loop in your code. This error can be caused by a for-loop or a while-loop that never ends. Check the hint or solution to see if this is the case.
If the viewing the solution didn't resolve the problem, please reach out directly to the DataCamp Help Desk for further assistance.