My loop ran all night and printed 4,000 lines because I forgot one equals sign | Coding For Beginners - Freelance Forum - The Community for Independent Professionals
My loop ran all night and printed 4,000 lines because I forgot one equals sign
Last weekend I was messing around with a little Python practice project, just a guess the number game to get better at loops. I typed `while guess = secret:` instead of `while guess != secret:`, hit run, and walked off to make a sandwich. Came back 20 minutes later to a black terminal scrolling forever and my laptop fan sounding like a tiny jet. I had to force quit it and my guess counter hit 4,127 before I killed the thing. Is there a way to stop a runaway loop besides Ctrl+C, or do you just suffer and learn like I did?