10
My first Python script crashed because I forgot a colon
I was trying to build a simple number guesser game last night, following a tutorial from a site called Codecademy. Everything was fine until I ran it and got a 'SyntaxError' right on line 7. I stared at the screen for a solid ten minutes before I saw it. I had written 'if guess == number' but completely forgot to put the colon at the end. It's such a tiny thing, but the whole program just stops. I felt pretty silly, but adding that one little character fixed it instantly. It's crazy how one missing symbol can break everything. Has anyone else had a simple mistake like that totally stump them when they were starting out?
2 comments
Log in to join the discussion
Log In2 Comments
jadeg8127d ago
Actually those tiny syntax errors are good, they teach you to be careful from the start.
9
kai_west27d ago
I spent an hour debugging a script once because I used a single equals sign in an if statement instead of a double. The error message was about invalid syntax, but my brain just refused to see it. It's wild how our eyes skip over those tiny details.
2