T
20

PSA: I broke my code trying to use a while loop for the first time

I spent 2 hours yesterday writing a while loop in Python to count down from 10. Forgot to add a break condition. Now my terminal has 14,000 lines of '10' scrolling and I had to force quit. Anyone else forget the basics and watch their computer melt down?
2 comments

Log in to join the discussion

Log In
2 Comments
claire_fisher41
Funny thing is, I bet the code totally worked as written. It just didn't stop when you wanted it to. Sometimes the computer does exactly what you tell it, not what you meant.
6
the_olivia
the_olivia1mo ago
Oh no, did your computer survive the loop of doom? I've definitely been there, it's so easy to forget the little things when you're just starting out.
5