Spent 4 hours debugging a calculator app because I put the colons in the wrong spot in my dictionary
Two weeks ago I was working on a little tip calculator to practice Python, and it kept throwing a KeyError no matter what I typed in. I checked my whole logic flow about six times, rewrote the same 15 lines from scratch, and even restarted my laptop because I was sure something was stuck in memory. Around hour four I finally printed the dictionary keys and saw the problem: I wrote my keys like "food:' 30" with the quote and colon flip-flopped on every single line, so Python was reading the whole thing as one weird string. My roommate heard me say "oh my god" from the other room and asked if I was okay. I fixed the colons in about 20 seconds and the calculator worked on the first try. I still don't know why my editor didn't even hint that something was off. Does anyone else's brain just stop seeing typos after staring at the same file for that long, or is it just me?