My loop kept printing the same line forever and I finally spotted the typo that caused it
Last Tuesday I was messing around with a little number guessing game in Python and my while loop just never stopped. The same line kept scrolling for like two straight minutes until I hit Ctrl+C, and I honestly thought my laptop froze. Turns out I wrote guess != number instead of guess != secret, so it was comparing the guess to itself and the condition was always true. I sat there staring at it for 20 minutes before my girlfriend looked over and pointed at the screen. Felt so dumb but also kind of proud that I figured out why it broke instead of just googling the whole program again. Does anyone else have a typo story that took way too long to find? I want to feel less alone here.
How long did it take before you noticed the line was printing the exact same thing every time? Like was it repeating one value over and over, or was it stuck on the same text the whole time? That part always trips me up because I keep assuming the loop is doing something when it's really just frozen in place. Curious how you finally spotted it too, was it the girlfriend pointing it out or did you trace it back through the code yourself?