Debugging with print() finally clicked after a 3 hour session
Spent last night on a simple loop that kept skipping every 3rd item in my list. I was sure the logic was right, so I added print() statements at each step to see the actual values. Turns out my index was starting at 1 instead of 0, classic beginner slip. Seeing the numbers printed out made it obvious in 5 minutes. I guess that's why everyone says trace through your data first. Has anyone else had a silly off-by-one error waste more time than it should have?
The part where you said "seeing the numbers printed out made it obvious in 5 minutes" really hit home for me. It's like how you can stare at a receipt for ages and not see the mistake, but the second you write every item and price down in a list, the overcharge just jumps out at you. Maybe our brains need to see the steps laid out one by one before the pattern finally clicks. It's honestly kind of humbling how a tiny thing like starting at 1 instead of 0 can eat up an entire evening. But I also think that's just how learning works, you gotta make the simple dumb mistakes a few times before they stick forever. These days I almost get suspicious when I write a loop and it works perfectly on the first try.