Debugging

What is a bug?

A bug is a problem in the way a program runs.

What does debugging mean?

Debugging is the process of identifying the cause of a bug and modifying code to fix the issue.

How do you debug a program?

One of the first steps in debugging is to understand error messages. They tell you where the interpreter had a problem and what kind of problem happened. Logical errors don't result in error messages, so you need to look at the program execution to resolve them. To debug logical errors, examine the value of variables at different points in the program's execution. Do this by inserting print() calls into strategic points in the code, logging the key variables values during execution, or using the debugging tools available in most IDEs. Also, write tests for your code to see which parents are working and which aren't.