n
20

Just realized my loop was running forever because I forgot a simple thing

I was messing with a while loop in Python and it just kept going, turns out I never incremented my counter variable. Has anyone else had a brain freeze moment like that with loops?
2 comments

Log in to join the discussion

Log In
2 Comments
mitchell.jessica
Spent a solid ten minutes staring at my screen because a for loop wouldn't end. I was iterating over a list but accidentally appending to it inside the loop, so it just kept growing forever. Felt like a real genius that day.
6
shanek62
shanek622d ago
Classic @mitchell.jessica, building a list that never quits.
4