My for loop printed 10 lines of gibberish for 2 days until I finally looked at the indentation
I'm about 3 weeks into learning Python and I kept getting these weird repeating errors on a simple loop that was supposed to count to 5. I copied code from 3 different tutorials and just figured the tutorial was wrong. Then a guy at my Tuesday coffee meetup glanced at it for maybe 4 seconds and said my print line was indented one level too deep. So it was printing inside the loop every time instead of at the end. Fixed the spacing and it worked first try. Two days of frustration over like 4 spaces. Has anyone else had a spacing issue eat up way more time than it should?
Man, my first month with Python I spent an entire Saturday on a function that kept returning nothing. Turns out my return statement was sitting one tab outside the function, so Python just ran the function and got None back every time. I was out there rewriting conditionals and blaming my logic when the whole thing was one tab. My wife kept asking why I was still at the laptop at dinner. Four spaces, one tab, same kind of pain. Now I run my code and look at the shape of it before I even read the error.