T
21

I spent 6 hours yesterday trying to figure out why my loop wouldn't stop.

I was making a simple number guessing game in Python and I forgot to update the variable inside the while loop, so it just kept asking forever.
2 comments

Log in to join the discussion

Log In
2 Comments
joseph_hart
Oh man, I feel that! I started adding a simple print statement right before the loop condition to check the variable each time. Seeing it stuck on the same number made the problem obvious in like two minutes. It saves me so much headache now.
3
the_piper
the_piper12d ago
Six hours? That's brutal. We've all been there staring at an infinite loop.
2