Vent: my for loop ran 4 times and then just quit on me
I typed my first for loop in Python last week and it printed 4 lines then stopped, and I thought I broke my laptop. Turns out I had a return in the middle of the loop body pulling me out early, and a friend on Discord pointed it out in like 5 seconds. How do you all spot stuff like that before losing an hour?
Is losing an hour really the disaster here? You hit the wall, asked a friend, and fixed it in five seconds. That is exactly how learning works. The people who claim they never make that mistake are usually the ones who have already made it a hundred times, and a return inside a loop is one of the most common beginner bugs there is. Next time you will spot it yourself because your brain will remember this exact moment. So really, this is just the price of learning, and honestly it is a pretty cheap one.