My loop ran forever on line 14 and I just stared at it for 20 minutes
Last Tuesday I was writing a little guessing game in Python at my kitchen table and my while loop kept running nonstop. I had written while guess = number: with one equals sign instead of two, so it never actually compared anything. My roommate walked by, pointed at line 14, and it clicked in like five seconds. How do you all catch these small typos before they eat your whole evening?
Ever watch someone else make the exact same mistake and just lose it? My buddy Dave did this thing where he typed if x = 5 instead of ==, and Python threw a fit right away, so at least he knew. But then he had one in a while loop like yours and sat there for like an hour thinking his logic was broken. He kept adding print statements everywhere trying to "debug" it, which did nothing because the loop condition was just always true. His girlfriend finally looked over and goes "honey, that's an assignment, not a check." He felt so dumb but honestly it happens to everyone. Now he runs his stuff early and often instead of writing the whole thing first, and that seems to catch most of it.