Code won't quit running or stop

Bug description:

Expected vs Current Behavior:

Steps to reproduce:

Bug appears at this link:

Screenshot(s)/Screen Recording:

Browser/OS/Device: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Replit Profile:

Hey @machebe!

Try running kill 1 in the Shell tab.


It didn’t work, thanks though

It’s because you’re using exit(). It has no use and is a bad practice anyway since it leads to memory leakage in other languages. Remove it from your code and the IDE will know the program has finished.


I actually need the exit() since it’s apart of the challenge that I’m doing

That makes sense. It’s strange that the course encourages you to do that, though.

1 Like

The course was made prior to the newer console changes, it was made before prybar was even removed.


It is usually easy to have your code not use exit(). (As a side note, sys.exit() is better but nearly equivalent to exit().)
In your case, replacing all exit() lines with break will work. break will break out of the while loop, reaching end of file and terminating the program without the use of exit().

Thanks for the help.

I’d agree, but it’s part of the course.