Saved Bookmarks
| 1. |
Explain logical error. |
|
Answer» A logic error is a defect in the program that causes it to produce an incorrect result, but one that is not so blatant as to be detectable as a runtime error. (A logic error in one part of the program might eventually trigger a runtime error in some other part of the program, but those are separate errors.) An example would be a function that is supposed to return the larger of its two arguments but in fact, returns the smaller: def larger(m, n): if (m > n): return n return m |
|