Dr. Martin Jones, the author behind the book and site Python for Biologists, has come up with a chart to help Python programmers when their code doesn’t work and they can’t figure out why.
He writes:
A few times a year, I have the job of teaching a bunch of people who have never written code before how to program from scratch. The nature of programming being what it is, the same error crop up every time in a very predictable pattern. I usually encourage my students to go through a step-by-step troubleshooting process when trying to fix misbehaving code, in which we go through these common errors one by one and see if they could be causing the problem. Today, I decided to finally write this troubleshooting process down and turn it into a flowchart in non-threatening colours.
Behold, the “my code isn’t working” step-by-step troubleshooting guide! Follow the arrows to find the likely cause of your problem – if the first thing you reach doesn’t work, then back up and try again.
It’s intended for programmers who are new to Python, but even experienced Pythonistas sometimes get distracted and stuck on simple things. I’m keeping a copy handy.
You can tap on the image above to view it at full size, and there’s also a printable PDF version as well.
[ Thanks to my UC Baseline classmate Daniel Jimenez for the find! ]
2 replies on ““My code isn’t working” is a great problems-and-solutions flowchart for Python programmers”
I love your chart, “My code isn’t working” where you summarize the errors that commonly occur in classroom. Can I it in a presentation for my colleagues (teachers)? We are working at upper secondary school.
Lennart Rolandsson: My apologies for taking so long to reply to you about the chart! It’s not my chart, but one by Dr. Martin Jones, and I believe he’s fine with people sharing the chart far and wide.