The Invent with Python Blog

Thu 15 August 2019

Python Error Messages: Gotta Catch Em All

Posted by Al Sweigart in misc   

Error messages can be intimidating for beginners to programming. They're often shown in red text, and may give the sense that the computer has been damaged or broken. Experienced programmers take them in stride; errors are just a casual fact of life, and correcting them is just a part of the programming process.

To make errors less intimidating, I've created a "Gotta Catch 'em All" worksheet that lists several common Python error messages. Instead of trying to avoid errors, beginners can try to hunt and collect them all. This makes errors less scary and gives an incentive for beginners to carefully read the error messages and figure out what causes them.

This worksheet can be useful for self-taught individuals or classroom and workshop instructors. As students encounter error messages, they can look them up on the worksheet to see if they've encountered them before. There's a space to write down the line of code that caused the error message, encouragement to do a web search for the error message, and a space to write down the solution they found.

PDF of the "Gotta Catch 'em All" worksheet (letter-sized)

Microsoft Word document of the worksheet

This worksheet could use some improvement. It'd be nice if the list of errors was expanded, or even if each kind of error (or error message) had a small Pokemon-like mascot. Perhaps putting these errors and mascots on cards instead of a worksheet would be good. I'm open to anyone who wants to take this idea and expand upon it.

If you have other ideas for how the worksheet could be improved or more error messages to add, email [email protected] or contact me on Twitter at @AlSweigart.