F
10

I was stuck on a simple loop for hours at the library coding meetup

I went to the free beginner coding meetup at the downtown library last Thursday. We were working on a basic Python exercise to print numbers. I wrote a for loop, but it kept printing the same number over and over. I stared at my screen for what felt like forever, getting more frustrated. A guy named Mark, who was just there to read, leaned over and said, 'Hey, I think your variable name inside the loop is wrong.' I had typed 'i' in the range but was trying to print a variable I called 'num'. It was such a tiny mistake, but I was totally blind to it. How do you guys catch your own simple errors when you're just starting out and stuck in your own head?
3 comments

Log in to join the discussion

Log In
3 Comments
kellyallen
kellyallen13h ago
Oh man, I feel that! I started reading my code out loud, and it sounds so dumb that I usually find the mistake.
2
the_rose
the_rose10h agoTop Commenter
What kind of stuff are you saying out loud? Like, are you explaining it to a rubber duck or just muttering the variables?
4
laura_wilson
Ugh, the worst! I got stuck on a loop like that once and felt so dumb. I started writing my variable names on a sticky note and checking them off as I used them. It forces you to slow down and actually look at what you typed. That simple checklist trick saved me from so many of those tiny, face-palm errors.
2