[go: up one dir, main page]

0% found this document useful (0 votes)
147 views1 page

Unit 4 CS Discussion Assignment

Uploaded by

Ben Obi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
147 views1 page

Unit 4 CS Discussion Assignment

Uploaded by

Ben Obi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

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.

Create your own example of each possibility in Python code. List the code for each
example, along with sample output from trying to run it.

The Three possibilities to consider if a function is not working are:

1. A precondition is violated

2. A postcondition is violated

3. There is something wrong with the return value or the way it is used

A precondition is a condition that has to do with the argument the function is


getting and displays what is to be true at the beginning of a function body

A postcondition is a condition that has to do with the function itself and displays
what is to be true at the end of a function body

You might also like