Question: Question 13: Functions (ILO 2 only) Both your code and written answers to this question will be stored in entries in the answer dictionary, although

Question 13: Functions (ILO 2 only)

Both your code and written answers to this question will be stored in entries in the answer dictionary, although your written answers will not be automatically assessed.

There is a function calledtest_thisdefined in the script file. You must not modify its implementation. You are to write both natural language answers about its operation and provide sets of inputs that will test (reach) each path through the function.

a. Given what you can see in the code, write a short description (1 or two sentences) of the function's domain and codomain. If you wish, you can use letters like N, Z and R to refer to the sets of natural numbers, integers and real numbers. (There are multiple correct answers.)

Now you will define Python sets that will specify test cases for the function. Your aim is that, used in combination, they would reach every exit point and also test boundary cases; you willnotbe checking that it gives the correct answer. Aim to make the sets as small as you can (in other words, do not make them extremely large to ensure coverage, craft them cleverly).

b. Write a Python set literal containing test values for theqparameter

c. Write a Python set literal containing test values for thepparameter

d. Write a Python set literal containing test values for thexparameter

And finally...

e. Your answers to many of the above questions, including this one, are stored in a Python dictionary. Thinking about thisdictobject as a function, how would you describe itscodomainusing natural language? A one-sentence description is sufficient.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!