Modern debugging tools will let you step through a running program line by line. You can examine the values of your variables and see where your errors are coming from. Learning to debug effectively will supercharge your programming ability.
PyCharm is a free IDE (code editor) that has a great debugging tool.
In this Gig, we'll download PyCharm and spend 30 minutes learning to use the debugger for a sample Python script.