Had the worst Tuesday of my 3 months learning Python when my loop kept printing on an endless scroll
I spent 40 minutes staring at my screen and my IDE just kept filling with the same line because I put the print inside my while loop instead of after it. I felt so dumb. The next morning it clicked in about two minutes after a coffee. How do you stop yourself from panicking when a bug turns out to be one small typo?
Small correction: the print being inside the loop isn't a typo. That's a logic mistake, and it's a different beast. A typo is a misspelled variable or a missing colon, something the computer catches right away with a red squiggle. Yours ran fine, which is exactly why it ate 40 minutes. Next time the screen floods, my move is to kill the run, take my hands off the keys, and read the loop out loud starting from the top. It's hard to skim past a misplaced line when your own mouth has to say it.