logic error
A mistake that lets a program run without any error message but makes it produce the wrong result.
In more detail
Python cannot detect it, because the code is valid; only checking results finds it. Playing computer, printing values, the debugger and automated tests are the tools for finding logic errors.
Related terms
- runtime error — An error that happens while a program is running, such as dividing by zero or using an undefined name, raised as an exception.
- playing computer — Following a program by hand, one statement at a time, writing down every variable's value in a table as it changes.
- debugging — Finding and fixing the cause of a bug, by observing what the program actually does and comparing it with what it should do.
- unit test — An automated check of one small piece of code, such as a single function, that runs quickly and on its own.
Taught in
- Playing Computer — Hands-on Python: Complete Video Course & Book
- Reading Error Messages — Hands-on Python: Complete Video Course & Book
- Debugging: print, breakpoint, and the debugger — Hands-on Python: Complete Video Course & Book
- Interpreter, Compiler, And What Counts As Syntax — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep