+ 1
How do we identify bugs in python
3 odpowiedzi
+ 1
Best way is to get other people to look at your program. Sometimes your eyes can get exhaust and you miss one little code.
0
Try debuging ^^
0
Think like a computer would. A computer will only follow the exact directions it is given. Step through each line of code, and work out on paper what it actually does, not what you think it should do. Usually, if an error is present, you will get a Traceback message that will point you to it (or at least in the right direction). However, not all bugs will produce error messages. That is why it is important to test as you write code, not just at the end. You don't want to bury a bug underneath a pile of working code.
P.S. You shouldn't learn to depend on them, but different IDEs provide you with the ability to step through code and identify errors fairly easily.