22
My entire Python script crashed because I forgot a single colon yesterday afternoon.
I spent 3 hours debugging a loop that was supposed to print numbers 1 through 10, only to realize the syntax error was right on the first line after the 'for' statement, so what's the dumbest little mistake that's ever wasted your time?
3 comments
Log in to join the discussion
Log In3 Comments
alice_hart1mo ago
Honestly used to think syntax errors were no big deal until last month. Tbh I spent a whole evening on a function that kept returning None. The issue was I wrote "is" instead of "==" in a simple if check. Felt like such a waste of time staring at the screen. Ngl it made me way more paranoid about double checking my conditionals now.
3
mark_price1mo ago
That "is" versus "==" trap gets everyone eventually. Did you have a specific value, like a number or a string, that was causing the None to slip through? I'm curious if it was failing on a zero or an empty string, something that would evaluate similarly.
5
the_jordan1mo ago
Didn't @alice_hart say she ran into that exact same thing? I read somewhere that using "is" for anything but None can cause weird bugs.
7