Question: Write a function that has the following properties: Its name must be median It has three integer parameters named a, b, and c It is

Write a function that has the following properties:

  1. Its name must be median
  2. It has three integer parameters named a, b, and c
  3. It is assumed that the three values a, b, and c are all different. You don't need to check it in the function.
  4. The function returns the median of the three values. In this case, it would be the "middle" value. That is, neither the smallest nor the largest. For example, if a is 4, b is 2, and c is 7, the function returns the value in a, which is 4.
  5. The function increments a global variable named number_of_calls by 1, each time it is called. Initialize the global variable to 0.

Your code must not use any Python library functions.

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!