Fix Some Syntax Errors
This experience continues the fun you had with debugging a Type Error. This time there’s a whole pile of errors to sort through!
- Clone this repository (no need to fork, or to use a forked version): https://github.com/Codenhance/debug_me.
- Try running
interview.py
. You should get a SyntaxError.
- Open the file in Vim, navigate to the line causing the error, and fix it. Note: sometimes the error is on the preceding line.
- Save, run the file again, and move on to the next error.
- Once the script is running, answer the questions. It will write a file.
- Upload this file to Slack and @mention me for a point
Here is a video of me debugging the whole thing. Only watch it if you get stuck!
Tips:
- In Vim, type
:9
and press enter to go straight to line 9. Each error tells you the offending line number, so you can go straight to the problem with laser focus.
- Pay attention to anything repetitive or frustrating. Are you pressing
j
and l
a hundred times? Try using /
to search, or w
and b
to go forward/backward one word at a time.
- Most errors are either stolen directly from the reading on “16 Common Errors” or can be detected by comparing the incorrect line with the lines above and below it.
- Ask for help on Slack if you’re stuck. I do not consider this cheating. I consider it “programming.” Knowing when and where to get help will save you tons of time.