Answer to Question #276412 in Python for solokin

Question #276412

Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working.


Describe each possibility in your own words.



Define "precondition" and "postcondition" as part of your description.


1
Expert's answer
2021-12-08T03:06:52-0500

1) Something wrong with the arguments the function is getting; a precondition is violated.

It indicates that either the argument is not corresponding to the perimeter or not returning the same as the variable or function. They arise a syntax error and Python parser is unable to understand a line of code.

2) Something wrong with the function; a postcondition is violated.

   To me is a semantic error. If there is an error in your code, it will work successfully and run like a perfect code that will not create any error messages. However, your program will not do the right thing.

     3) Something wrong with the return value or the way it is being used.

The error that occurs during the execution of code. In distinction, compile-time errorshappen while a program is being compiled. Usually indicates bugs in the program or problems due to trying to return value incorrectly are Runtimeerrors.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS