3
My code finally ran after two days of staring at a missing semicolon
I was following a Python tutorial from a site called Codecademy, building a simple number guesser. For 48 hours straight, the console just spat out 'invalid syntax' on line 7. I checked the logic, the variables, everything. My friend looked at it over my shoulder and pointed at the end of line 6. I'd forgotten a semicolon in a completely different spot, and the error message was totally misleading. Has anyone else had a bug where the error pointed to the wrong line entirely?
3 comments
Log in to join the discussion
Log In3 Comments
emery_craig1mo ago
Missing semicolons are the worst (my brain just refuses to see them). I once spent an hour on a typo where I wrote "ture" instead of "true".
7
elizabeth_ramirez1mo ago
Oh man, that reminds me of a time I kept getting a "list index out of range" error. I was sure my loop math was wrong, but it turned out I had accidentally typed a period instead of a comma when I first made the list days earlier. The error only showed up way later when I tried to use it. Felt like my own code was gaslighting me.
6
tarac161mo ago
Oh, that feeling is the absolute worst. Those misleading error messages can send you down such a deep rabbit hole. It's amazing how one tiny, absent character can bring everything to a halt. Your friend deserves a medal for spotting that.
2